Problem: Let's call some square matrix with integer values in its cells palindromic if it doesn't change after the order of rows is reversed and it doesn't change after the order of columns is reversed.

For example, the following matrices are palindromic:

<image>

The following matrices are not palindromic because they change after the order of rows is reversed:

<image>

The following matrices are not palindromic because they change after the order of columns is reversed:

<image>

You are given n^2 integers. Put them into a matrix of n rows and n columns so that each number is used exactly once, each cell contains exactly one number and the resulting matrix is palindromic. If there are multiple answers, print any. If there is no solution, print "NO".

Input

The first line contains one integer n (1 ≤ n ≤ 20).

The second line contains n^2 integers a_1, a_2, ..., a_{n^2} (1 ≤ a_i ≤ 1000) — the numbers to put into a matrix of n rows and n columns.

Output

If it is possible to put all of the n^2 numbers into a matrix of n rows and n columns so that each number is used exactly once, each cell contains exactly one number and the resulting matrix is palindromic, then print "YES". Then print n lines with n space-separated numbers — the resulting matrix.

If it's impossible to construct any matrix, then print "NO".

You can print each letter in any case (upper or lower). For example, "YeS", "no" and "yES" are all acceptable.

Examples

Input


4
1 8 8 1 2 2 2 2 2 2 2 2 1 8 8 1


Output


YES
1 2 2 1
8 2 2 8
8 2 2 8
1 2 2 1


Input


3
1 1 1 1 1 3 3 3 3


Output


YES
1 3 1
3 1 3
1 3 1


Input


4
1 2 1 9 8 4 3 8 8 3 4 8 9 2 1 1


Output


NO


Input


1
10


Output


YES
10 

Note

Note that there exist multiple answers for the first two examples.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vll = vector<ll>;
constexpr int MOD = 1e9 + 7;
constexpr int INF = INT_MAX;
constexpr ll LLINF = LLONG_MAX;
template <class T>
inline bool setmin(T &a, T b) {
  if (a > b) return a = b, 1;
  return 0;
}
template <class T>
inline bool setmax(T &a, T b) {
  if (a < b) return a = b, 1;
  return 0;
}
namespace vector_magic {
template <class T>
istream &operator>>(istream &os, vector<T> &container) {
  for (auto &u : container) os >> u;
  return os;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &container) {
  for (auto &u : container) os << u << " ";
  return os;
}
}  // namespace vector_magic
using namespace vector_magic;
namespace fastio {
template <typename... args>
void re(args &...tail) {
  ((cin >> tail), ...);
}
template <typename... args>
void pr(args... tail) {
  ((cout << tail << " "), ...);
}
template <typename... args>
void prln(args... tail) {
  ((cout << tail << " "), ...);
  cout << "\n";
}
}  // namespace fastio
using namespace fastio;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  re(n);
  vi ile(1001);
  vector<vi> res(n, vi(n));
  for (int i = (0); i <= (n * n - 1); i++) {
    int x;
    re(x);
    ile[x]++;
  }
  for (int _ile = (4); _ile >= (1); _ile--) {
    for (int i = (0); i <= (n - 1); i++) {
      for (int j = (0); j <= (n - 1); j++) {
        if (res[i][j]) {
          continue;
        }
        int temp = (i != (n - 1 - i));
        temp += (j != (n - 1 - j));
        temp += (i != (n - 1 - i) and (j != n - 1 - j));
        temp += 1;
        if (temp != _ile) {
          continue;
        }
        for (int k = (1); k <= (1000); k++) {
          if (ile[k] >= temp) {
            res[i][j] = res[n - 1 - i][j] = k;
            res[i][n - 1 - j] = res[n - 1 - i][n - 1 - j] = k;
            ile[k] -= temp;
            break;
          } else if (k == 1000) {
            prln("NO");
            exit(0);
          }
        }
      }
    }
  }
  prln("YES");
  for (auto &i : res) {
    prln(i);
  }
  exit(0);
}