#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<ll, ll>;

const ll INF = 2e18;

int main() {
  ll n;
  cin >> n;
  vector<vector<ll>> c(n, vector<ll>(n));
  rep(i, n) rep(j, n) cin >> c[i][j];
  bool f = 1;
  rep(j, n - 1) {
    ll t = c[0][j] - c[0][j + 1];
    rep(i, n) {
      if (c[i][j] - c[i][j + 1] != t) {
        f = 0;
        break;
      }
    }
  }

  if (f) {
    cout << "Yes" << endl;
    vector<ll> mn(n, INF);
    rep(j, n) rep(i, n) mn[j] = min(mn[j], c[j][i]);
    rep(i, n) cout << mn[i] << ' ';
    cout << endl;
    rep(i, n) cout << c[0][i] - mn[0] << ' ';
    cout << endl;

  } else {
    cout << "No" << endl;
  }
  return 0;
}

#include <bits/stdc++.h>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int n;
ll c[501][501];
ll lc[501][501];
ll a[501],b[501];
ll difa[501];
ll difsuma[501];
ll difb[501];
ll difsumb[501];

bool solve(){
	for(int i=0;i+1<n;i++){
		difa[i]=c[0][i+1]-c[0][i];
		for(int j=0;j<n;j++){
			if(difa[i]!=(c[j][i+1]-c[j][i])){
				return false;
			}
		}
	}
	for(int i=0;i+1<n;i++){
		difb[i]=c[i+1][0]-c[i][0];
		for(int j=0;j<n;j++){
			if(difb[i]!=(c[i+1][j]-c[i][j])){
				return false;
			}
		}
	}
	for(int i=0;i<n;i++){
		difsuma[i+1]=difsuma[i]+difa[i];
		difsumb[i+1]=difsumb[i]+difb[i];
	}
	ll difamin=0;
	ll difbmin=0;
	for(int i=0;i<=n;i++){
		difamin=min(difamin,difsuma[i]);
		difbmin=min(difbmin,difsumb[i]);
	}
	if(-(difamin+difbmin)>c[0][0])return false;
	ll ch=c[0][0]+(difamin+difbmin);
	for(int i=0;i<n;i++){
		a[i]=difsuma[i]-difamin+ch;
		b[i]=difsumb[i]-difbmin;
	}
	return true;
}

int main(void){
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			scanf("%lld",&c[i][j]);
		}
	}
	if(!solve()){
		printf("No\n");
		return 0;
	}
	printf("Yes\n");
	for(int i=0;i<n;i++){
		printf("%lld%c",b[i],(i+1==n)?'\n':' ');
	}
	for(int i=0;i<n;i++){
		printf("%lld%c",a[i],(i+1==n)?'\n':' ');
	}
	return 0;
}
