#include <bits/stdc++.h>
/*

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

*/
#define pii pair<int,int>
#define fi first
#define pb push_back
#define si second
#define int   long long
#define mod   998244353
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define double long double
#define all(o) o.begin(),o.end()



/*
#define T pair<int, int>
#define ordered_set tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>
*/


using namespace std;



int power(int x, int y)
{
    int res = 1LL;
    x = x % mod;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % mod;
        y = y>>1; // y = y/2
        x = (x*x) % mod;
    }
    return res%mod;
}
int inv(int  n)
{
    return power(n,mod-2)%mod;
}
int isprime(int n){
    if(n<2)return 0;
    int i;
    for(i=2;i*i<=n;i++)
        if(n%i==0)
            return 0;
    return 1;
}
void files(){  
    // For getting input from input.txt file 
    freopen("lca.in", "r", stdin);   
    // Printing the Output to output.txt file 
    freopen("lca.out", "w", stdout); 

}

int egcd(int a,int b,int &x ,int & y){
    if(b==0){
        x=1;y=0;
        return a;
    }
    int x1,y1;
    int g=egcd(b,a%b,x1,y1);
    x=y1;
    y=x1-(a/b)*y1;
    return g; 
}
const int N=2e6;
//https://codeforces.com/blog/entry/22747
// https://codeforces.com/blog/entry/89609


int n,c[505][505],a[505],b[505];
void solve(){

    cin>>n;
    int i,j,k;
    for(i=1;i<=n;i++)
        for(j=1;j<=n;j++)
            cin>>c[i][j];

    for(i=1;i<=n;i++){
        int ok=1;
        
        for(j=1;j<=n;j++)
        {   b[j]=c[i][j];
            a[j]=c[j][1]-b[1];
            if(a[j]<0)
            ok=0;    
        }
        if(ok==0)continue;
        for(j=1;j<=n;j++)
            for(k=1;k<=n;k++)
                if(c[j][k]!=a[j]+b[k] )
                    ok=0;
        if(ok)
        {
            cout<<"Yes\n";
            for(j=1;j<=n;j++)
                cout<<a[j]<<" ";
            cout<<"\n";

            for(j=1;j<=n;j++)
                cout<<b[j]<<" ";
            cout<<"\n";
            return;
        }
    }

    cout<<"No\n";




} 
int32_t main(){ 
      fast
    int t=1;
      // cin>>t;    
    while(t--) 
    {
      solve();
    }
}
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}void pr(){ln;}
template<class A,class...B>void pr(const A &a,const B&...b){cout<<a<<(sizeof...(b)?" ":"");pr(b...);}
template<class A>void PR(A a,ll n){rep(i,n)cout<<(i?" ":"")<<a[i];ln;}
const ll MAX=1e9+7,MAXL=1LL<<61,dx[8]={-1,0,1,0,-1,-1,1,1},dy[8]={0,1,0,-1,-1,1,1,-1};
typedef pair<ll,ll> P;

void Main() {
  ll n;
  R n;
  ll c[n][n];
  rep(i,n)rep(j,n) R c[i][j];
  set<vector<ll> > s1,s2;
  rep(i,n) {
    vector<ll> a,b;
    rep(j,n-1) {
      a.pb(c[i][j+1]-c[i][j]);
      b.pb(c[j+1][i]-c[j][i]);
    }
    s1.in(a);
    s2.in(b);
  }
  if(s1.size()>1||s2.size()>1) {
    pr("No");
    return;
  }
  vector<ll> v=*s1.begin();
  ll M=0,x=0;
  rep(i,v.size()) {
    x+=v[i];
    M=min(M,x);
  }
  vector<ll> b;
  x=-M;
  b.pb(x);
  rep(i,v.size()) {
    x+=v[i];
    b.pb(x);
  }
  vector<ll> a;
  rep(i,n) a.pb(c[i][0]-b[0]);
  pr("Yes");
  PR(a,n);
  PR(b,n);
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}
