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;
const long long MAXN = 200100;
const long long INF = 2000000100;
const long long MOD = 998244353;
int N, N2;
int num[410];
int ans[22][22];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> N;
  N2 = N * N;
  for (int i = 0; i < N2; i++) {
    cin >> num[i];
  }
  sort(num, num + N2);
  vector<pair<long long, long long> > cnt;
  cnt.push_back(pair<long long, long long>(num[0], 1));
  for (int i = 1; i < N2; i++) {
    if (num[i] != num[i - 1]) {
      cnt.push_back(pair<long long, long long>(num[i], 1));
    } else {
      cnt[(int)cnt.size() - 1].second++;
    }
  }
  int x = 0, y = 0;
  if (N % 2 == 0) {
    for (int i = 0; i < (int)cnt.size(); i++) {
      if (cnt[i].second % 4 != 0) {
        cout << "NO\n";
        return 0;
      }
      while (cnt[i].second > 0) {
        ans[x][y] = ans[N - 1 - x][y] = ans[x][N - 1 - y] =
            ans[N - 1 - x][N - 1 - y] = cnt[i].first;
        cnt[i].second -= 4;
        x++;
        if (x == N / 2) x = 0, y++;
      }
    }
  } else {
    int vbar = 0;
    int hbar = 0;
    bool cent = 0;
    for (int i = 0; i < (int)cnt.size(); i++) {
      while (cnt[i].second >= 4 && y != N / 2) {
        ans[x][y] = ans[N - 1 - x][y] = ans[x][N - 1 - y] =
            ans[N - 1 - x][N - 1 - y] = cnt[i].first;
        cnt[i].second -= 4;
        x++;
        if (x == N / 2) x = 0, y++;
      }
      while (cnt[i].second >= 2 && vbar != N / 2) {
        ans[N / 2][vbar] = ans[N / 2][N - 1 - vbar] = cnt[i].first;
        cnt[i].second -= 2;
        vbar++;
      }
      while (cnt[i].second >= 2 && hbar != N / 2) {
        ans[hbar][N / 2] = ans[N - 1 - hbar][N / 2] = cnt[i].first;
        cnt[i].second -= 2;
        hbar++;
      }
      while (cnt[i].second >= 1 && !cent) {
        ans[N / 2][N / 2] = cnt[i].first;
        cnt[i].second--;
        cent = 1;
      }
      if (cnt[i].second > 0) {
        cout << "NO\n";
        return 0;
      }
    }
  }
  cout << "YES\n";
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      cout << (j != 0 ? " " : "") << ans[j][i];
    }
    cout << "\n";
  }
}