#include <bits/stdc++.h>

using namespace std;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define Rrep(i,n) for (ll i = n - 1; i >= 0;i--)
#define ll long long int
#define INF 1000000007
#define llINF 1000000000000000007
#define v(i) vector<i>
#define vv(i) vector<vector<i>>
// int num = atoi(string.c_str()); 文字列の整数変換
// sort(a,a+n,greater<int>()); 昇順ソートif(ans>llINF/a&&a !=0)return 0;
int digit(ll n){int ans=0;while(n>0){n /= 10; ans++;}return ans;}//桁数
ll _pow(ll a,ll b){ll ans = 1;rep(i,b){ans = a * ans;}return ans;}//階乗
ll _modpow(ll a, ll n, ll mod) {ll res = 1;while (n > 0) {if (n & 1){ res = res * a % mod;}a = a * a % mod;n >>= 1;}return res;}
ll gcd(ll a, ll b){if (a%b == 0){return(b);}else{return(gcd(b, a%b));}}//最大公約数
ll lcm(ll a, ll b){return a * b / gcd(a, b);} //最小公倍数
struct UnionFind {
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
        for(int i = 0; i < N; i++) par[i] = i;
    }

    int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);//経路圧縮
    }

    void unite(int x, int y) { // xをyの木に併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    }

    bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }};
ll cmb(ll n, ll r){ll X = 1;for(int i = n; i >= n - r + 1;i--){X = X * i % INF;}ll Y = 1;for(int i = r;i > 0 ;i--){Y = Y * i % INF;}Y = _modpow(Y,(ll)INF-2,(ll)INF);return X * Y % INF;}

  int main(){
      ll n;cin>>n;
      ll c[n][n];
      ll tmp = 0;
      ll m = INF;
      rep(i,n){
          rep(j,n){
              cin>>c[i][j];
              if(c[i][j] < m){
                  m = c[i][j];
                  tmp = i;
              }
          }
      }
      v(ll)a,b;
      rep(i,n){
          b.push_back(c[tmp][i]);
      }
      rep(i,n){
          ll now = c[i][0] - b[0];
          rep(j,n){
              if(c[i][j] - b[j] != now){
                  cout<<"No"<<endl;
                  return 0;
              }
          }
          a.push_back(now);
      }
      cout<<"Yes"<<endl;
      rep(i,n){
          cout<<a[i]<<" ";
      }cout<<endl;
      rep(i,n){
          cout<<b[i]<<" ";
      }cout<<endl;
      return 0;
  }
/*
Author: Zcus
Blog: cnblogs.com/Zcus
*/

#include <bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define pb push_back
#define pii pair<int, int>
#define mp make_pair
#define debug(x) cout << #x << " = " << x << endl
#define For(i, x, y) for (int i = x; i <= y; i++) 
#define Rep(i, x, y) for (int i = x; i >= y; i--) 
#define file(FILE_NAME) freopen(FILE_NAME".in", "r", stdin), freopen(FILE_NAME".out", "w", stdout)
#define filein(FILE_NAME) freopen(FILE_NAME".in", "r", stdin);
#define fileout(FILE_NAME) freopen(FILE_NAME".out", "w", stdout);

template<class T> inline bool Chkmax(T& x, const T& y) { return x < y ? x = y, true : false; }
template<class T> inline bool Chkmin(T& x, const T& y) { return x > y ? x = y, true : false; }

#define I int
inline I ri() {
	I s = 0, w = 1;
	char c = getchar();
	while (c < '0' || c > '9') {if (c == '-') w = -1; c = getchar();}
	while (c >= '0' && c <= '9') { s = (s << 1) + (s << 3) + (c ^ 48); c = getchar();}
	return s * w;
}
#undef I

#define int long long
const int maxn = 510;

int n;
int c[maxn][maxn];

int x, y;
int ss = 0;

int bb[maxn], aa[maxn];
signed main() {
	ios :: sync_with_stdio(0); cin.tie(0);
	cin >> n;

	For (i, 1, n) For (j, 1, n) cin >> c[i][j];
	For (i, 2, n) bb[i] = c[1][i] - c[1][i - 1];
	For (i, 2, n) aa[i] = c[i][1] - c[i - 1][1];
	//a[2] + b[2] = 
	//x + aa[2] + y + bb[2] = a[2][2];
	aa[1] = 0, bb[1] = c[1][1];
	for (int i = 1; i <= n; i++) bb[i] = bb[i - 1] + bb[i];
	for (int i = 1; i <= n; i++) aa[i] = aa[i - 1] + aa[i];
	int pos1 = -1, minn = 0;
	for (int i = 1; i <= n; i++) {
		if (aa[i] < 0) {
			pos1 = 1;
			Chkmin(minn, aa[i]);
		}
		if (bb[i] < 0) {
			pos1 = 2;
			Chkmin(minn, bb[i]);
		}
	}
	minn = -minn;
	if (pos1 == 1) {
		for (int i = 1; i <= n; i++) aa[i] += minn, bb[i] -= minn;
	}
	if (pos1 == 2) for (int i = 1; i <= n; i++) bb[i] += minn, aa[i] -= minn;
	for (int i = 1; i <= n; i++) {
		if (aa[i] < 0 || bb[i] < 0) {
			puts("No"); return 0;
		}
	}
	int ok = 1;
	For (i, 1, n) For (j, 1, n) if (c[i][j] != aa[i] + bb[j]) ok = 0;
	if (ok == 1) {
		puts("Yes");
		for (int i = 1; i <= n; i++) printf("%lld ", aa[i]);
		puts("");
		for (int i = 1; i <= n; i++) printf("%lld ", bb[i]);
		return 0;
	}
	else {
		printf("No");
	}
	return 0;
}
