#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=(a); i<(b); i++)
using namespace std;
using ll = long long;
using vi = vector<int>;
using vv = vector<vi>;
const int INF = 1001001001;

int main(){
    int n; cin >> n;
    vi a(n), b(n);
    int bmin = INF;
    rep(i,0,n){
        cin >> b[i];
        bmin = min(bmin, b[i]);
    }
    a[0] = b[0];
    rep(j,1,n){
        cin >> a[j];
        rep(i,1,n){
            int c; cin >> c;
            if(b[0]+c != a[j] + b[i]){
                cout << "No" << endl;
                return 0;
            }
        }
    }
    cout << "Yes" << endl;
    rep(i,0,n)cout<<a[i]-(b[0]-bmin)<<(i==n-1?'\n':' ');
    rep(i,0,n)cout<<b[i]-bmin<<(i==n-1?'\n':' ');
    return 0;
}
#pragma GCC optimize("Ofast")
#pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define pb push_back
const long double Pi = 3.141592653;
const ll mod=1e9+7;
long long INF = 1000000000000000000;
bool cmp(pair<int,int>a,pair<int,int>b)
{
    return (a.first<b.first) || (a.first==b.first && a.second>b.second);
}
int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t=1;//cin>>t;
    while(t--)
    {
        int n;cin>>n;
        ll a[n][n],sum=0,sum1=0;
        for(int i=0;i<n;i++)
        {
            for(int j=0;j<n;j++)
            {
                cin>>a[i][j];
                sum+=a[i][j];
                if(i==j)
                sum1+=a[i][j];
            }
        }
        if(sum%n)
        cout<<"No";
        else
        {
            ll h=sum/n;
            if(h!=sum1)
            cout<<"No";
            else
            {
                ll pref[n]={0},mi=1e18;
                for(int i=0;i<n;i++)
                {
                    for(int j=0;j<n;j++)
                    {
                        pref[i]+=a[i][j];
                    }
                    mi=min(mi,pref[i]);
                }
                bool ok=true;sum=0;
                vector <int>a1(n),b(n);
                for(int i=0;i<n;i++)
                {
                    ll g=pref[i]-mi;
                    if(g%n || g<0)
                    ok=false;
                    else
                    {
                        a1[i]=g/n;
                        sum+=a1[i];
                    }
                }
                ll suff[n]={0};
                for(int i=0;i<n;i++)
                {
                    for(int j=0;j<n;j++)
                    {
                        suff[i]+=a[j][i];
                    }
                }
                for(int i=0;i<n;i++)
                {
                    ll g=suff[i]-sum;
                    if(g%n || g<0)
                    ok=false;
                    else
                    {
                        b[i]=g/n;
                    }
                }
                if(ok)
                {
                    cout<<"Yes"<<endl;
                    for(int i=0;i<n;i++)
                    cout<<a1[i]<<" ";
                    cout<<endl;
                    for(int i=0;i<n;i++)
                    cout<<b[i]<<" ";
                }
                else
                cout<<"No";
            }
        }
    }
}