#include<bits/stdc++.h>
#define N 505
#define ll long long
#define inf 0x3f3f3f3f
using namespace std;
bool mmp1;
int n,m,K;
namespace P100 {
	int C[N][N];
	int A[N],B[N];
	int D[N][N];
	void solve() {
		scanf("%d",&n);
		for(int i=1;i<=n;i++)
			for(int j=1;j<=n;j++)
				scanf("%d",&C[i][j]);
		for(int i=1;i<=n;i++)
			B[i]=C[1][i];
		for(int i=1;i<=n;i++)
			A[i]=C[i][1]-B[1];
		int ma=A[1],mb=B[1];
		for(int i=2;i<=n;i++)ma=min(ma,A[i]);
		for(int i=2;i<=n;i++)mb=min(mb,B[i]);
		if(ma+mb<0){
			puts("No");
			return;
		}else if(ma<0)for(int i=1;i<=n;i++)A[i]-=ma,B[i]+=ma;
		for(int i=1;i<=n;i++)
			for(int j=1;j<=n;j++){
				// printf("D[%d][%d]=%d\n",i,j,A[i]+B[j]);
				if(C[i][j]!=A[i]+B[j]){
					puts("No");
					return;
				}
			}
		puts("Yes");
		for(int i=1;i<=n;i++)
			printf("%d ",A[i]);
		puts("");
		for(int i=1;i<=n;i++)
			printf("%d ",B[i]);
	}
}
bool mmp2;
int main() {
//	srand(time(0));
//	printf("%.6fMB\n",(&mmp2-&mmp1)/1024.0/1024);
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	P100::solve();
	return 0;
}

#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;
using ll=long long;
using ld=long double;
//using mint = modint1000000007;
#define rep(i,n) for (ll i=0; i<n; ++i)
#define all(c) begin(c),end(c)
#define PI acos(-1)
#define oo 2e18
template<typename T1, typename T2>
bool chmax(T1 &a,T2 b){if(a<b){a=b;return true;}else return false;}
template<typename T1, typename T2>
bool chmin(T1 &a,T2 b){if(a>b){a=b;return true;}else return false;}
//priority_queue<ll, vector<ll>, greater<ll>> Q;
/*
250000
２ぶたん？
最初のAさえ決まればあとは全部？

*/
ll C[550][550];
int main(){
  cin.tie(0);
  ios::sync_with_stdio(0);
  cout << fixed << setprecision(10);
  ll N;
  cin >> N;
  ll low = 1e9;
  ll high = 0;
  rep(i, N) rep(j, N)cin >> C[i][j];
  rep(i, N) rep(j, N){
    chmin(low, C[i][j]);
    chmax(high, C[i][j]);
  }
  // lowより小さい数だけが候補
  // さが同じかどうか
  ll dif[550] = {};
  rep(i, N-1){
    dif[i] = C[i+1][0] - C[i][0];
    rep(j, N){
      if (C[i+1][j] - C[i][j] != dif[i]){
        cout << "No" << endl;
        return 0;
      }
    }
  }
  ll bmin=1e9;
  // Bは一番小さい数がある行
  ll B[550]={};
  rep(i, N) chmin(bmin, C[i][0]);
  rep(i, N){
    if (C[i][0] == bmin)
    {
      rep(j, N) B[j] = C[i][j];
      break;
    }
  }
  ll A[550] = {};
  rep(i, N){
    A[i] = C[i][0] - bmin;
  }
  cout << "Yes" << endl;
  rep(i, N){
    cout << A[i];
    if (i==N-1) cout << endl;
    else cout << " ";
  }
  rep(i, N){
    cout << B[i];
    if (i==N-1) cout << endl;
    else cout << " ";
  }
}
