#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;}

///Bismillahir Rahmanir Rahim
/*
    Author: Tanzin Ahammad
*/
#include<bits/stdc++.h>
#define        u64             uint64_t
#define        ll              long long
#define        endl            "\n"
#define        PI              acos(-1)
#define        fi              first
#define        si              second
#define        pb              push_back
#define        set0(arr)       memset(arr, 0, sizeof(arr))
#define        setinf(arr)     memset(arr, 126, sizeof(arr))
#define        gcd(a,b)        __gcd(a,b)
#define        lcm(a,b)        (a*b)/gcd(a,b)
#define        all(x)          (x).begin(),(x).end()
#define        sz(v)           ((ll)(v).size())
#define        mem(a,b)        memset(a, b, sizeof(a))
#define        uniq(v)         (v).erase(unique(all(v)),(v).end())
#define        mchk(mask,pos)  (mask & (1<<pos))
#define        mset(mask,pos)  (mask bitor (1<<pos))
#define        munset(mask,pos) (mask ^ (1<<pos))
#define        IOS             ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
using          pll        =      pair<ll, ll> ;
using          vl         =      vector<ll> ;
using          vpll       =      vector<pll> ;
using          mll        =      map<ll, ll> ;
using          mcl        =      map<char, ll> ;
using          msl        =      map<string,ll> ;
using          sl         =      set<ll> ;
using          sc         =      set<char> ;
const int N = 1e6+5;
const int mod = (int)  1e9 + 7;
ll arr[N];
ll sumd(ll a,ll b){return (((a%mod)+(b%mod))%mod);}
ll muld(ll a,ll b){return (((a%mod)*(b%mod))%mod);}
ll subd(ll a,ll b){return (((a%mod)-(b%mod)+mod)%mod);}



int main()
{
    IOS;

    ll tc,n,x,i,j;
    cin>>n;
    ll M[n][n];
    for(i=0;i<n;i++)
    {
           for(j=0;j<n;j++)
           {
                  cin>>M[i][j];
           }
    }
    for(i=0;i<n;i++)
    {
           vl vt1,vt2;
           for(j=0;j<n;j++)
           {
                 vt2.pb(M[i][j]);
                 x=M[j][j]-M[i][j];
                 if(x<0) break;
                 vt1.pb(x);
           }
           if(sz(vt1)<n) continue;
           ll f=0;
           for(ll i1=0;i1<n;i1++)
           {
                  for(ll j1=0;j1<n;j1++)
                  {
                         if((vt1[i1]+vt2[j1])!=M[i1][j1])
                         {
                                f=1;break;
                         }
                  }
           }
           if(f==0)
           {
                  cout<<"Yes"<<endl;
                  for(auto p:vt1) cout<<p<<" ";
                  cout<<endl;
                  for(auto p:vt2) cout<<p<<" ";
                  cout<<endl;
                  return 0;
           }
    }
    cout<<"No"<<endl;





    return 0;
}

