#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <functional>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <bitset>
#include <math.h>
#include <random>
#include <chrono>
#include <assert.h>
using namespace std ;
using ll = long long ;
using ld = long double ;
template<class T> using V = vector<T> ;
template<class T> using VV = V<V<T>> ;
using pll = pair<ll,ll> ;
#define all(v) v.begin(),v.end()
ll mod = 1000000007 ;
long double pie = acos(-1) ;
ll INF = 1e18 ;

void yorn(bool a){if(a) cout << "Yes" << endl ; else cout << "No" << endl ;}
//void YorN(bool a){if(a) cout << "YES" << endl ; else cout << "NO" << endl ;}
ll gcd(long long a,long long b){if(b==0) return a ; return gcd(b,a%b) ;}
ll lcm(long long a,long long b){return a/gcd(a,b)*b ;}
ll extGCD(ll a,ll b,ll &x,ll &y){
    if(b==0){
        x = 1 ;
        y = 0 ;
        return a ;
    }
    ll d = extGCD(b,a%b,y,x) ;
    y -= a/b*x ;
    return d ;
}
void fix_cout(){cout << fixed << setprecision(20) ;}
template<class T> void chmax(T &a,T &b){if(a<b) a = b ;}
template<class T> void chmin(T &a,T &b){if(a>b) a = b ;}

int main(){
    int n ; cin >> n ;
    VV<ll> c(n,V<ll>(n)) ;
    for(auto &i:c) for(auto &j:i) cin >> j ;
    V<pair<ll,ll>> a(n),b(n) ;
    a[0] = {1,0} ;
    for(int i=1;i<n;i++) a[i] = {1,a[i-1].second+c[0][i]-c[0][i-1]} ;
    b[0] = {-1,c[0][0]} ;
    for(int i=1;i<n;i++) b[i] = {-1,b[i-1].second+c[i][0]-c[i-1][0]} ;
    bool ok = true ;
    for(int i=0;i<n;i++) for(int j=0;j<n;j++){
        ok &= c[i][j]==(a[j].second+b[i].second) ;
    }
    ll mn=INF,mx=-INF ;
    for(int i=0;i<n;i++){
        mx = max(mx,-a[i].second) ;
        mn = min(mn,b[i].second) ;
    }
    ok &= mx<=mn ;
    if(!ok) cout << "No" << endl ;
    else{
        cout << "Yes" << endl ;
        ll x = mn ;
        for(int i=0;i<n;i++) cout << -x+b[i].second << (i+1==n?"\n":" ") ;
        for(int i=0;i<n;i++) cout << x+a[i].second << (i+1==n?"\n":" ") ;
    }
}
// URL
#include <iostream>
#include <vector>
using namespace std;

#define loop(i, a, b) for (int i = a; i < b; i++)
#define mp make_pair
#define pb push_back
#define sz size
#define rsz resize
typedef long long LL;
const char NL = '\n';
const char SP = ' ';
const char HB[] = "HOBA";
const LL llinf = 9e18;
const int iinf = 2e9;

ostream& operator<< (ostream& os, vector <int> v) {
  for (int i = 0; i < v.size(); i++) {
    os << v[i] << SP;
  }
  os << NL;
  return os;
}

int main() {
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n;
  m = n;
  int c[n][m];
  vector <int> b(m, iinf);
  vector <vector <int> > a(n);
  loop (i, 0, n) {
    a[i].rsz(m);
    loop (j, 0, m) {
      cin >> c[i][j];
    }
  }

  loop (j, 0, m) {
    loop (i, 0, n) {
      b[j] = min(b[j], c[i][j]);
    }
  }
  loop (j, 0, m) {
    loop (i, 0, n) {
      a[i][j] = c[i][j] - b[j];
    }
  }
  loop (j, 1, m) {
    loop (i, 0, n) {
      if (a[i][j] != a[i][j - 1]) {
        cout << "No\n";
        exit(0);
      }
    }
  }
  cout << "Yes\n";
  loop (i, 0, n) {
    cout << a[i][0] << SP;
  }
  cout << NL;
  loop (j, 0, m) {
    cout << b[j] << SP;
  }
  cout << NL;
  return 0;
}
/*
SAMPLE
*/