#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <math.h>
#include <cassert>
#define rep(i,n) for(int i = 0; i < n; ++i )
using namespace std;
using ll = long long;

ll c[500][500];
int main() {
  int n;
  cin >> n;
  rep(i,n)rep(j,n) cin >> c[i][j];
  vector<ll> a(n),b(n);
  rep(i,n-1){
    ll d = c[i+1][0]-c[i][0];
    rep(j,n) if(c[i+1][j]-c[i][j]!=d){
      cout << "No" << endl;
      return 0;
    }
    a[i+1] = d;
  }
  rep(j,n-1){
    ll d = c[0][j+1]-c[0][j];
    rep(i,n) if(c[i][j+1]-c[i][j]!=d){
      cout << "No" << endl;
      return 0;
    }
    b[j+1] = d;
  }
  rep(_,2){
    ll s=0,m=0;
    rep(i,n) s += a[i], m = min(m,s), a[i] = s;
    rep(i,n) a[i] -= m;
    swap(a,b);
  }
  rep(i,n)rep(j,n){
    if(c[i][j]<a[i]+b[j]){
      cout << "No" << endl;
      return 0;
    }
  }
  rep(i,n) a[i] = c[i][0]-b[0];
  
  cout << "Yes" << endl;
  rep(i,n) printf("%lld%c",a[i],i==n-1?'\n':' ');
  rep(i,n) printf("%lld%c",b[i],i==n-1?'\n':' ');
}

#include<bits/stdc++.h>
using namespace std;

#define rep(i,n) for(int i = 0; i < n; i++)
#define Rep(i,n) for(int i = 1; i <= n; i++)
#define sz(a) int(a.size())
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define fin(a) { cout << a << endl; return 0; }
#define debug(a) { cerr << #a << ": " << a << endl; }
#define endl '\n'
#define fi first
#define se second
using lint = long long;
using ld = long double;
using P = pair<int,int>;
using Pl = pair<lint,lint>;
template<class T> using V = vector<T>;
template<class T> using priq     = priority_queue<T>;
template<class T> using priq_inv = priority_queue<T, vector<T>, greater<T>>;
const int dx[] = {0,1,0,-1,1,1,-1,-1};
const int dy[] = {1,0,-1,0,1,-1,-1,1};
template<class T> T ceil(const T &a, const T &b) { return ((a)+(b)-1)/b; }
template<class T> bool chmin(T &a, T b) { if(a > b) { a = b; return 1; } return 0; }
template<class T> bool chmax(T &a, T b) { if(a < b) { a = b; return 1; } return 0; }
template<class T> void YesorNo(T x) { printf(x ? "Yes\n" : "No\n"); }
struct INF { template<class T> operator T() { return numeric_limits<T>::max() / 2; } } INF;

template<class T, class U> istream& operator>>(istream &in, pair<T,U> &p) {
    return in >> p.first >> p.second;
}
template<class T, class U> ostream& operator<<(ostream &out, const pair<T,U> &p) {
    return out << '{' << p.first << ',' << p.second << '}';
}
template<class T> istream& operator>>(istream &in, vector<T> &v) {
    for(auto &&e : v) in >> e;
    return in;
}
template<class T> ostream& operator<<(ostream &out, const vector<T> &v) {
    for(const auto &e : v) out << e << ' ';
    return out;
}

/*----------------------------------------------------------------------------------------------------*/


int main(){
    int n;
    cin >> n;
    V<V<int>> c(n,V<int>(n));
    cin >> c;
    bool ok = true;
    rep(i,n)rep(j,n-1) {
        ok &= (c[i][j+1]-c[i][j] == c[0][j+1]-c[0][j]);
    }
    rep(j,n)rep(i,n-1) {
        ok &= (c[i+1][j]-c[i][j] == c[i+1][0]-c[i][0]);
    }
    if(!ok) fin("No");

    V<int> d(n-1);
    Rep(i,n-1) d[i-1] = c[0][i]-c[0][i-1];

    int l = -1, r = INF;
    while(r-l > 1) {
        int mid = (l+r)/2;
        int now = mid;
        bool ok = true;
        rep(i,n-1) {
            now += d[i];
            if(now < 0) ok = false;
        }
        if(ok) r = mid;
        else l = mid;
    }
    V<int> b(n); b[0] = r;
    rep(i,n-1) b[i+1] = b[i] + d[i];
    V<int> a(n);
    rep(i,n) {
        a[i] = c[i][0]-b[0];
        if(a[i] < 0) fin("No");
    }
    cout << "Yes" << endl;
    cout << a << endl << b << endl;
}