#include <iostream>

using namespace std;

template <size_t n> void print(int (&a)[n][n])
{
  for (size_t q=0; q<n; ++q)
  {
    for (size_t w=0; w<n; ++w)
      cout << a[q][w] << ' ';
    
    cout << endl;
  }

  cout << endl;
}

int main()
{
  int a[][2] = {{1,2}, {3,4}};
  int b[][3] = {{1,2,3}, {4,5,6}, {7,8,9}};
  
  print(a);
  print(b);
  
  return 0;
}