#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
const int INF = 1e9;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep2(i, x, n) for(int i = x; i < (n); i++)
#define all(n) begin(n), end(n)

void Main() {
    int n;
    cin >> n;
    vector<vector<int>> c(n, vector<int>(n));
    rep(i, n) rep(j, n) cin >> c[i][j];
    vector<int> a(n), b(n);
    a[0] = 0;
    rep(i, n) {
        if(i == 0) {
            rep(j, n) { b[j] = c[i][j] - a[0]; }
        } else {
            int ai = c[i][0] - b[0];
            rep(j, n) {
                if(c[i][j] - b[j] != ai) {
                    cout << "No" << endl;
                    return;
                }
            }
            a[i] = ai;
        }
    }

    int mini = INF;
    rep(i, n) if(a[i] < mini) mini = a[i];
    // cout << mini << endl;
    if(mini < 0) {
        rep(i, n) a[i] -= mini;
        rep(i, n) b[i] += mini;
    }

    mini = INF;
    rep(i, n) if(b[i] < mini) mini = b[i];
    // cout << mini << endl;
    if(mini < 0) {
        rep(i, n) b[i] -= mini;
        rep(i, n) a[i] += mini;
    }

    rep(i, n) if(a[i] < 0 || b[i] < 0) {
        cout << "No" << endl;
        return;
    }
    
    cout << "Yes" << endl;
    rep(i, n) {
        if(i == n - 1)
            cout << a[i] << endl;
        else
            cout << a[i] << " ";
    }
    rep(i, n) {
        if(i == n - 1)
            cout << b[i] << endl;
        else
            cout << b[i] << " ";
    }
}

int main() {
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}
#include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<algorithm>
#include<utility>
#include<tuple>
#include<map>
#include<queue>
#include<deque>
#include<set>
#include<stack>
#include<numeric>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>

using namespace std;

struct Edge {
  int to;
  long long weight;
  Edge() : to(0), weight(0) {}
  Edge(int to, long long weight) : to(to), weight(weight) {}
  Edge(const Edge& e) {
    to = e.to;
    weight = e.weight;
  }
};

using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using Graph = vector<vector<int>>;
using weightedGraph = vector<vector<Edge>>;
using heap = priority_queue<int, vector<int>, greater<int>>;

#define BIL ((ll)1e9)
#define MOD ((ll)1e9+7)
#define INF (1LL<<60)
#define inf (1<<29)

int main(int argc,char* argv[]){
  cin.tie(0);
  ios::sync_with_stdio(0);
  cout << fixed << setprecision(20);
  int n;
  cin >> n;
  vector<vector<ll>> c(n, vector<ll>(n, 0));
  for(int i=0;i<n;i++) {
    for(int j=0;j<n;j++) {
      cin >> c[i][j];
    }
  }
  ll v = INF;
  for(int i=0;i<n;i++) {
    v = min(v, c[i][0]);
  }
  vector<ll> a(n);
  for(int i=0;i<n;i++) {
    a[i] = c[i][0] - v;
  }
  vector<ll> b(n);
  for(int i=0;i<n;i++) {
    ll k = 0;
    for(int j=0;j<n;j++) {
      if(j == 0) {
        k = c[j][i] - a[j];
        continue;
      }
      ll m = c[j][i] - a[j];
      if(k != m) {
        cout << "No" << endl;
        return 0;
      }
    }
    if(k < 0) {
      cout << "No" << endl;
      return 0;
    }
    b[i] = k;
  }
  cout << "Yes" << endl;
  for(int i=0;i<n;i++) {
    cout << a[i];
    if(i != n-1) cout << " ";
  }
  cout << endl;
  for(int i=0;i<n;i++) {
    cout << b[i];
    if(i != n-1) cout << " ";
  }
  cout << endl;
  return 0;
}
