#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (long long i = 0; i < (n); i++)
using ll = long long;
using P = pair<ll, ll>;
const ll INF = 1001001001;

int main() {
    ll N; cin >> N;
    vector<vector<ll>> C(N, vector<ll>(N));
    vector<ll> A(N), B(N);
    // (最小値, 最小値が含まれる行数) を表す Pair
    P min_val(INF, 0);
    rep(i, N) rep(j, N) {
        ll val;
        cin >> val;
        if (min_val.first > val) {
            min_val = make_pair(val, i);
        }
        C[i][j] = val;
    }
    bool ok = true;
    A[min_val.second] = min_val.first;
    for (ll i = 0; i < N; i++) {
        B[i] = C[min_val.second][i] - A[min_val.second];
    }
    for (ll i = 0; i < N; i++) {
        A[i] = C[i][0] - B[0];
    }
    rep(i, N) rep(j, N) {
        if (C[i][j] != A[i] + B[j]) ok = false;
        if (A[i] < 0 || B[j] < 0) ok = false;
    }
    if (ok) {
        cout << "Yes" << endl;
        rep(i, N) cout << A[i] << endl;
        rep(i, N) cout << B[i] << endl;
    }
    else cout << "No" << endl;

    return 0;
} 
#include<bits/stdc++.h>
using namespace std;
using ll = long long int;
using ld = long double;
#define pow(n,m) powl(n,m);
#define sqrt(n) sqrtl(n);
const ll MAX = 5000000000000000000;
const ll MOD = 1000000007;
//998244353;
void randinit(){srand((unsigned)time(NULL));}
int main(){
    ll N;
    cin >> N;
    vector<vector<ll>> C(N,vector<ll>(N,0));
    for(ll i = 0;i < N;i++) for(ll j = 0;j < N;j++) cin >> C[i][j];
    ll p = MAX;
    for(ll i = 0;i < N;i++) p = min(p,C[i][0]);
    vector<ll> A(N),B(N);
    A[0] = p;
    B[0] = C[0][0] - p;
    for(ll i = 0;i < N;i++) A[i] = C[i][0] - B[0];
    for(ll i = 0;i < N;i++) B[i] = C[0][i] - A[0];
    bool b = 1;
    for(ll i = 0;i < N;i++) if(0 > A[i]) b = 0;
    for(ll i = 0;i < N;i++) if(0 > B[i]) b = 0;
    for(ll i = 0;i < N;i++){
        for(ll j = 0;j < N;j++){
            if(A[i] + B[j] != C[i][j]){
                b = 0;
                break;
            }
        }
        if(b == 0) break;
    }
    if(b){
        cout << "Yes\n";
        for(ll i = 0;i < N - 1;i++) cout << A[i] << " ";
        cout << A[N - 1] << endl;
        for(ll i = 0;i < N - 1;i++) cout << B[i] << " ";
        cout << B[N - 1] << endl;
        return 0;
    }
    B[0] = p;
    A[0] = C[0][0] - p;
    for(ll i = 0;i < N;i++) A[i] = C[i][0] - B[0];
    for(ll i = 0;i < N;i++) B[i] = C[0][i] - A[0];
    b = 1;
    for(ll i = 0;i < N;i++) if(0 > A[i]) b = 0;
    for(ll i = 0;i < N;i++) if(0 > B[i]) b = 0;
    for(ll i = 0;i < N;i++){
        for(ll j = 0;j < N;j++){
            if(A[i] + B[j] != C[i][j]){
                b = 0;
                break;
            }
        }
        if(b == 0) break;
    }
    if(b){
        cout << "Yes\n";
        for(ll i = 0;i < N - 1;i++) cout << A[i] << " ";
        cout << A[N - 1] << endl;
        for(ll i = 0;i < N - 1;i++) cout << B[i] << " ";
        cout << B[N - 1] << endl;
        return 0;
    }
    p = MAX;
    for(ll i = 0;i < N;i++) p = min(p,C[0][i]);
    B[0] = p;
    A[0] = C[0][0] - p;
    for(ll i = 0;i < N;i++) A[i] = C[i][0] - B[0];
    for(ll i = 0;i < N;i++) B[i] = C[0][i] - A[0];
    b = 1;
    for(ll i = 0;i < N;i++) if(0 > A[i]) b = 0;
    for(ll i = 0;i < N;i++) if(0 > B[i]) b = 0;
    for(ll i = 0;i < N;i++){
        for(ll j = 0;j < N;j++){
            if(A[i] + B[j] != C[i][j]){
                b = 0;
                break;
            }
        }
        if(b == 0) break;
    }
    if(b){
        cout << "Yes\n";
        for(ll i = 0;i < N - 1;i++) cout << A[i] << " ";
        cout << A[N - 1] << endl;
        for(ll i = 0;i < N - 1;i++) cout << B[i] << " ";
        cout << B[N - 1] << endl;
        return 0;
    }
    A[0] = p;
    B[0] = C[0][0] - p;
    for(ll i = 0;i < N;i++) A[i] = C[i][0] - B[0];
    for(ll i = 0;i < N;i++) B[i] = C[0][i] - A[0];
    b = 1;
    for(ll i = 0;i < N;i++) if(0 > A[i]) b = 0;
    for(ll i = 0;i < N;i++) if(0 > B[i]) b = 0;
    for(ll i = 0;i < N;i++){
        for(ll j = 0;j < N;j++){
            if(A[i] + B[j] != C[i][j]){
                b = 0;
                break;
            }
        }
        if(b == 0) break;
    }
    if(b){
        cout << "Yes\n";
        for(ll i = 0;i < N - 1;i++) cout << A[i] << " ";
        cout << A[N - 1] << endl;
        for(ll i = 0;i < N - 1;i++) cout << B[i] << " ";
        cout << B[N - 1] << endl;
        return 0;
    }
    cout << "No\n";
}
