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

typedef long long ll;
typedef unsigned long long ull;
typedef double dbl;
typedef float flt;

#define for0(i, n) for(ll i=0; i<n; i++)
#define for1(i, n) for(ll i=1; i<=n; i++)
#define forab(i, a, b) for(ll i=a; i<=b; i++)
#define clr0(a) memset(a, 0, sizeof(a))

void solve() {
    ll n;
    cin >> n;
    ll a[n+5][n+5];
    for1(i, n) {
        for1(j, n) {
            cin >> a[i][j];
        }
    }
    ll row[n+5], col[n+5];
    bool pos = true;
    for1(j, n) {
        if (j==1) {
            row[j] = 0;
        }
        else {
            row[j] = a[1][j] - a[1][1];
        }
    }
    for1(i, n) {
        if (i==1) {
            col[i] = 0;
        }
        else {
            col[i] = a[i][1] - a[1][1];
        }
    }
    forab(i, 2, n) {
        forab(j, 2, n) {
            ll rd = a[i][j] - a[i][1];
            ll cd = a[i][j] - a[1][j];
            if (rd!=row[j] || cd!=col[i]) {
                pos = false;
            }
        }
    }
    if (!pos) {
        cout << "No" << endl;
    }
    else {
        cout << "Yes" << endl;
        ll rmn=99999999;
        ll cmn=99999999;
        ll offset;

        for1(i, n) {
            rmn = min(rmn, row[i]);
            cmn = min(cmn, col[i]);
        }
        if (rmn<=cmn) {
            offset = abs(rmn);
        }
        else {
            offset = a[1][1] - abs(cmn);
        }

        /*
        forab(i, 0, a[1][1]) {
            bool fnd = true;
            for1(j, n) {
                if (row[1]+i + col[j]+a[1][1]-i != a[1][j]) {
                    fnd = false;
                    break;
                }
            }
            if (fnd==true) {
                offset = i;
                break;
            }
        }
        */

        for1(i, n) {
            cout << col[i]+a[1][1]-offset << " ";
        }
        cout << endl;
        for1(j, n) {
            cout << row[j]+offset << " ";
        }
        cout << endl;

    }
}

void testcase() {
    ll t;
    cin >> t;
    while (t--) {
        solve();
    }
}

int main () {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    //testcase();
    solve();

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n;
int main()
{
	cin >> n; vector<vector<int> > C( n,vector<int>( n ) );
	vector<int> A( n ), B( n );
	for( auto &i:C )	for( auto &j:i )	cin >> j;
	int minval=numeric_limits<int>::max(),mini=0,minj=0;
	for( int i=0;i<n;++i )
	{
		for( int j=0;j<n;++j )
		{
			if( C[i][j]<minval )	minval=C[i][j],mini=i,minj=j;
		}
	}
	for( int i=0;i<n;++i )	B[i]=C[mini][i];
	for( int i=0;i<n;++i )
	{
		if( C[i][minj]-minval<0 )	exit( ( puts( "No" ),0 ) );
		A[i]=C[i][minj]-minval;
		for( int j=0;j<n;++j )
		{
			if( ( C[i][minj]-minval )^( C[i][j]-B[j] ) )	exit( ( puts( "No" ),0 ) );
		}
	}
	puts( "Yes" );
	for( int i:A )	cout << i << ' '; cout << "\n";
	for( int i:B )	cout << i << ' '; cout << "\n";
	return 0;
}