#include <bits/stdc++.h>

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ls (p << 1)
#define rs (ls | 1)
#define tm ((tl + tr) >> 1)
#define lowbit(x) ((x) & -(x))

using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

constexpr double eps = 1e-8;
constexpr int NINF = 0xc0c0c0c0;
constexpr int INF = 0x3f3f3f3f;
constexpr ll LNINF = 0xc0c0c0c0c0c0c0c0;
constexpr ll LINF = 0x3f3f3f3f3f3f3f3f;
constexpr ll mod = 1e9 + 7;
constexpr ll N = 5e2 + 5;

int n, c[N][N], a[N], b[N], da[N], db[N];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    cin >> n;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            cin >> c[i][j];
        }
    }
    for (int i = 1; i < n; i++) {
        da[i] = c[i][0] - c[i - 1][0];
        db[i] = c[0][i] - c[0][i - 1];
    }
    int id1 = 0, id2 = 0;
    for (int i = 1; i < n; i++) {
        da[i] += da[i - 1];
        db[i] += db[i - 1];
        if (id1 == 0 || da[i] < da[id1]) {
            id1 = i;
        }
        if (id2 == 0 || db[i] < db[id2]) {
            id2 = i;
        }
    }
    // if (c[0][0] > da[id1] + db[id2]) {
    //     cout << "No\n";
    //     return 0;
    // }
    if (da[id1] < 0) {
        a[0] = abs(da[id1]);
        c[0][0] -= a[0];
    }
    if (db[id2] < 0) {
        b[0] = abs(db[id2]);
        c[0][0] -= b[0];
    }
    if (c[0][0] < 0) {
        cout << "No\n";
        return 0;
    } else {
        a[0] += c[0][0];
        c[0][0] = a[0] + b[0];
    }
    for (int i = 1; i < n; i++) {
        a[i] = a[0] + da[i];
        b[i] = b[0] + db[i];
    }
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (a[i] + b[j] != c[i][j]) {
                cout << "No\n";
                return 0;
            }
        }
    }
    cout << "Yes\n";
    for (int i = 0; i < n; i++) cout << a[i] << " \n"[i == n - 1];
    for (int i = 0; i < n; i++) cout << b[i] << " \n"[i == n - 1];

    return 0;
}
#include<iostream>
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define int long long
using namespace std;
int c[502][502],a[502],b[502];
signed main(){
    ios::sync_with_stdio(false);
    int n; cin>>n;
    rep(i,1,n)rep(j,1,n)cin>>c[i][j];
    bool flag=true;
    rep(i,1,n){rep(j,2,n){
        if(i==1)a[j]=c[i][j]-c[i][j-1];
        else if(a[j]!=c[i][j]-c[i][j-1]){flag=false;break;}
    }if(!flag)break;}
    if(!flag){cout<<"No\n";return 0;}
    rep(j,1,n){rep(i,2,n){
        if(j==1)b[i]=c[i][j]-c[i-1][j];
        else if(b[i]!=c[i][j]-c[i-1][j]){flag=false;break;}
    }if(!flag)break;}
    if(!flag){cout<<"No\n";return 0;}
    int mna=0,mnb=0;
    rep(i,1,n){
        a[i]+=a[i-1],b[i]+=b[i-1];
        mna=min(mna,a[i]),mnb=min(mnb,b[i]);
    }
    //cout<<mna<<" "<<mnb<<endl;
    if(c[1][1]+mna+mnb<0){cout<<"No\n";return 0;}
    int ada=-mna,adb=c[1][1]-ada;
    cout<<"Yes\n";
    rep(i,1,n)cout<<b[i]+adb<<" ";
    cout<<endl;
    rep(i,1,n)cout<<a[i]+ada<<" ";
    cout<<endl;
    return 0;
}