output_description: Print your solution in the following format:
  
      
      
      a_{1,1} ... a_{1,N}
      :
      a_{N,1} ... a_{N,N}
      
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
attempt: tmp = 1
  flag = 0
  n = int(input())
  mat = [[0] * n for i in range(n)]
  for i in range(0, 2 * n, 2):
      for j in range(i + 1):
          try:
              if flag == 0:
                  mat[i - j][j] = tmp
                  flag = 1
                  tmp += 1
              else:
                  mat[i - j][j] = (n * n + 1) // 2 - tmp + 2
                  flag = 0
          except:
              pass
  for i in range(n):
      for j in range(n):
          if mat[i][j] == 0:
              a = 1
              b = 1
              c = 1
              d = 1
              if i - 1 >= 0:
                  a = mat[i - 1][j]
              if i + 1 <= n - 1:
                  b = mat[i + 1][j]
              if j - 1 >= 0:
                  c = mat[i][j - 1]
              if j + 1 <= n - 1:
                  d = mat[i][j + 1]
              mat[i][j] = a * b * c * d + 1
  for i in mat:
      print(*i)
  
problem_description: Statement
  
  You are given an integer N.
  
  Construct any one N-by-N matrix a that satisfies the conditions below. It can
  be proved that a solution always exists under the constraints of this problem.
  
    * 1 \leq a_{i,j} \leq 10^{15}
    * a_{i,j} are pairwise distinct integers.
    * There exists a positive integer m such that the following holds: Let x and y be two elements of the matrix that are vertically or horizontally adjacent. Then, {\rm max}(x,y) {\rm mod} {\rm min}(x,y) is always m.
samples: [{"input": "2", "output": "4 7\n    23 10\n    \n\n  * For any two elements x and y that are vertically or horizontally adjacent, {\\rm max}(x,y) {\\rm mod} {\\rm min}(x,y) is always 3."}]