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: N = int(input())
  
  n_1 = N % 2
  n_2 = N // 2
  
  PN = [2]
  L = 3
  while len(PN) < N * 2:
      c = True
      for p in PN:
          if L % p == 0:
              c = False
      if c == True:
          PN.append(L)
      L += 2
  
  a = [[1] * N for _ in range(N)]
  b = [[1] * N for _ in range(N)]
  
  if n_1 == 1:
      w = 1
      for i in range(n_2):
          if w > 0:
              for j in range(i + 1):
                  a[i + j][i - j] = PN[4 * i]
                  a[i - j][i + j] = PN[4 * i]
                  a[N - 1 - i + j][N - 1 - i - j] = PN[4 * i + 1]
                  a[N - 1 - i - j][N - 1 - i + j] = PN[4 * i + 1]
                  b[i + j][N - 1 - i + j] = PN[4 * i + 2]
                  b[i - j][N - 1 - i - j] = PN[4 * i + 2]
                  b[N - 1 - i + j][i + j] = PN[4 * i + 3]
                  b[N - 1 - i - j][i - j] = PN[4 * i + 3]
          else:
              for j in range(i + 1):
                  a[i + j][i - j] = PN[-4 * (i - 1) - 1]
                  a[i - j][i + j] = PN[-4 * (i - 1) - 1]
                  a[N - 1 - i + j][N - 1 - i - j] = PN[-4 * (i - 1) - 2]
                  a[N - 1 - i - j][N - 1 - i + j] = PN[-4 * (i - 1) - 2]
                  b[i + j][N - 1 - i + j] = PN[-4 * (i - 1) - 3]
                  b[i - j][N - 1 - i - j] = PN[-4 * (i - 1) - 3]
                  b[N - 1 - i + j][i + j] = PN[-4 * (i - 1) - 4]
                  b[N - 1 - i - j][i - j] = PN[-4 * (i - 1) - 4]
          w *= -1
      r = (n_2 - 1) // 2 + 1
      for j in range(n_2 + 1):
          a[n_2 + j][n_2 - j] = PN[4 * r]
          a[n_2 - j][n_2 + j] = PN[4 * r]
          b[n_2 + j][n_2 + j] = PN[4 * r + 1]
          b[n_2 - j][n_2 - j] = PN[4 * r + 1]
  else:
      w = 1
      for i in range(n_2):
          if w > 0:
              for j in range(i + 1):
                  a[i + j][i - j] = PN[4 * i]
                  a[i - j][i + j] = PN[4 * i]
                  a[N - 1 - i + j][N - 1 - i - j] = PN[4 * i + 1]
                  a[N - 1 - i - j][N - 1 - i + j] = PN[4 * i + 1]
                  b[i + 1 + j][N - 1 - i + j] = PN[4 * i + 3]
                  b[i - j][N - 2 - i - j] = PN[4 * i + 3]
                  b[N - 1 - i + j][i + 1 + j] = PN[4 * i + 2]
                  b[N - 2 - i - j][i - j] = PN[4 * i + 2]
          else:
              for j in range(i + 1):
                  a[i + j][i - j] = PN[-4 * (i - 1) - 1]
                  a[i - j][i + j] = PN[-4 * (i - 1) - 1]
                  a[N - 1 - i + j][N - 1 - i - j] = PN[-4 * (i - 1) - 2]
                  a[N - 1 - i - j][N - 1 - i + j] = PN[-4 * (i - 1) - 2]
                  b[i + 1 + j][N - 1 - i + j] = PN[-4 * (i - 1) - 4]
                  b[i - j][N - 2 - i - j] = PN[-4 * (i - 1) - 4]
                  b[N - 1 - i + j][i + 1 + j] = PN[-4 * (i - 1) - 3]
                  b[N - 2 - i - j][i - j] = PN[-4 * (i - 1) - 3]
          w *= -1
  
  c = [[1] * N for _ in range(N)]
  for i in range(N):
      for j in range(N):
          c[i][j] = a[i][j] * b[i][j]
  
  if n_1 == 1:
      for i in range(n_2 + 1):
          for j in range(n_2):
              c[2 * i][1 + 2 * j] += c[2 * i][1 + 2 * j - 1] * c[2 * i][1 + 2 * j + 1]
      for i in range(n_2):
          for j in range(n_2 + 1):
              c[1 + 2 * i][2 * j] += c[1 + 2 * i - 1][2 * j] * c[1 + 2 * i + 1][2 * j]
  else:
      for i in range(n_2 - 1):
          for j in range(n_2):
              c[1 + 2 * i][2 * j] += c[1 + 2 * i - 1][2 * j] * c[1 + 2 * i + 1][2 * j]
              c[1 + 2 * i + 1][2 * j + 1] += (
                  c[1 + 2 * i - 1 + 1][2 * j + 1] * c[1 + 2 * i + 1 + 1][2 * j + 1]
              )
      for j in range(n_2 - 1):
          c[0][1 + 2 * j] += c[0][1 + 2 * j - 1] * c[0][1 + 2 * j + 1]
          c[-1][2 + 2 * j] += c[-1][2 + 2 * j - 1] * c[-1][2 + 2 * j + 1]
      c[0][-1] += a[0][-2] * a[1][-1] * b[0][-2]
      c[-1][0] += a[-2][0] * a[-1][1] * b[-1][1] * 2
  
  print(PN)
  for C in c:
      print(*C)
  
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."}]