#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef pair<ll, ll> pl;
struct edge {
    ll to;     // 辺の行き先
    ll weight; // 辺の重み
    edge(ll t, ll w) : to(t), weight(w) { }
};
typedef vector<vector<ll> > Graph;
typedef vector<vector<edge> > WGraph;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep3(i, k, n) for(int i = k; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define pb push_back
#define vout(v) for(int index_vout=0; index_vout < v.size(); index_vout++) cout<<v[index_vout]<<' '
#define blank cout<<endl
#define newvar(n) ll n; cin >> n
#define uniquify(vec) (vec).erase(std::unique((vec).begin(), (vec).end()), (vec).end())
const ll MOD = 1e9 + 7;
const ll INF = MOD*MOD+1;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    vector<vl> c(n);
    rep(i,n){
        rep(j, n){
            ll x;
            cin >> x;
            c[i].pb(x);
        }
    }
    vector<vl> dif(n, vl(n-1));
    rep(i,n){
        rep(j,n-1){
            dif[i][j] = c[i][j+1] - c[i][j];
        }
    }
    bool chk = true;
    rep(i,n){
        rep(j, n-1){
            if(dif[0][j] != dif[i][j]) chk = false;
        }
    }

    if(!chk){
        cout << "No";
        return 0;
    }
    cout << "Yes" << endl;
    ll m = INF;
    ll m_i;
    ll m_j;
    rep(i,n){
        rep(j,n){
            if(c[i][j] < m){
                m_i = i;
                m_j = j;
                m = c[i][j];
            }
        }
    }

    vl m_dif(n);
    rep(i,n) cout << c[i][m_j] - m << ' ';
    cout << endl;

    vout(c[m_i]);
    cout << endl;







    return 0;
}

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main () {
  int N;
  cin >> N;
  ll A[550][550];
  for (int i = 0; i < N; i ++) {
    for (int j = 0; j < N; j ++) {
      cin >> A[i][j];
    }
  }
  ll dif_r[550];
  ll dif_c[550];
  for (int i = 0; i < N - 1; i ++) {
    dif_c[i] = A[0][i + 1] - A[0][i];
  }
  for (int i = 0; i < N - 1; i ++) {
    dif_r[i] = A[i + 1][0] - A[i][0];
  }
  for (int i = 0; i < N; i ++) {
    for (int j = 0; j < N; j ++) {
      if (i < N - 1) {
        if (A[i + 1][j] - A[i][j] != dif_r[i]) {
          cout << "No" << endl;
          return 0;
        }
      }
      if (j < N - 1) {
        if (A[i][j + 1] - A[i][j] != dif_c[j]) {
          cout << "No" << endl;
          return 0;
        }
      }
    }
  }
  ll mi_r = 0;
  ll nr = 0;
  for (int i = 0; i < N - 1; i ++) {
    nr += dif_r[i];
    mi_r = min(mi_r, nr);
  }
  ll mi_c = 0;
  ll nc = 0;
  for (int i = 0; i < N - 1; i ++) {
    nc += dif_c[i];
    mi_c = min(mi_c, nc);
  }
  mi_r *= -1;
  mi_c *= -1;
  if (mi_r + mi_c > A[0][0]) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
  nr = mi_r;
  nc = A[0][0] - mi_r;
  dif_r[N] = 0;
  dif_c[N] = 0;
  for (int i = 0; i < N; i ++) {
    cout << nr << (i < N - 1 ? " " : "");
    nr += dif_r[i];
  }
  cout << endl;
  for (int i = 0; i < N; i ++) {
    cout << nc << (i < N - 1 ? " " : "");
    nc += dif_c[i];
  }
  cout << endl;
}