#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>
using namespace std; 
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i < (int)(n); i++)
#define length size()
#define int long long
#define ll long long
#include <cstdint>
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    if(n==0) return 0;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
const int MOD = 1000000007;
const int mod = 998244353;
const int MAX = 510000;
const int inf = 400000000000000;
template<typename T> string join(vector<T> &vec ,const string &sp){
    int si = vec.length;
    if(si==0){
        return "";
    }else{
        stringstream ss;
        rep(i,si-1){
            ss << vec[i] << sp;
        }
        ss << vec[si - 1];
        return ss.str();
    }
}
vector<vector<int>> ruiseki2d(vector<vector<int>> vec){
    rep(i,vec.size()-1){
        rep(j,vec[0].size()-1){
            vec[i+1][j+1] = vec[i][j+1]+vec[i+1][j]-vec[i][j]+vec[i+1][j+1];
        }
    }
    return vec;
}
class CompareDist
{
public:
    bool operator()(pair<int,int> p,pair<int,int>q){
    return p.second > q.second;
}
};
int ctoi(const char c){
  switch(c){
    case '0': return 0;
    case '1': return 1;
    case '2': return 2;
    case '3': return 3;
    case '4': return 4;
    case '5': return 5;
    case '6': return 6;
    case '7': return 7;
    case '8': return 8;
    case '9': return 9;
    default : return -1;
  }
}
vector<int> dijkstra(vector<vector<pair<int,int>>> vec,int s){
    priority_queue<pair<int,int>,vector<pair<int,int>>,CompareDist> que;
    pair<int,int> f = make_pair(s,0);//point,cost;
    que.push(f);
    bool y = false;
    vector<int> cost(vec.size(),inf);
    while(!que.empty()){
        pair<int,int> tmp = que.top();
        que.pop();
        int p = tmp.first;
        int c = tmp.second;
        if(cost[p]>c){
        cost[p] = c;
        rep(i,vec[p].size()){
            if(cost[vec[p][i].first]<=inf){
            tmp = make_pair(vec[p][i].first,vec[p][i].second+c);
            que.push(tmp);
            }
        }
        }
        if(!y) cost[p] = inf;
        y = true;
    }
    return cost;
}
signed main(void){
    int n;
    cin >> n;
    vector<vector<int>> vec(n,vector<int>(n));
    rep(i,n){
        rep(j,n){
            cin >> vec[i][j];
        }
    }
    vector<int> vx(n,0);
    vector<int> vy(n,0);
    bool flag = false;
    rep(i,n-1){
        int t = vec[0][i+1]-vec[0][i];
        rep(j,n-1){
            if(vec[j+1][i+1]-vec[j+1][i]!=t)  flag = true;
        }
        vx[i+1] = t;
        
    }
    rep(i,n-1){
        int t = vec[i+1][0]-vec[i][0];
      //  cout << t << " ";
        rep(j,n-1){
            if(vec[i+1][j+1]-vec[i][j+1]!=t)  flag = true;
        }
        vy[i+1] = t;
    }
    rep(i,n-1){
        vx[i+1] += vx[i];
        vy[i+1] += vy[i];
    }
   // cout << join(vx," ") << endl;
   // cout << join(vy," ") << endl;
    
    if(flag) cout << "No" << endl;
    else{
        //cout << "Yes" << endl;
        int xm = *min_element(vx.begin(),vx.end());
        int ym = *min_element(vy.begin(),vy.end());
        xm *= -1;
        ym *= -1;
       // cout << xm << " " << ym << endl;
        rep(i,n){
            vx[i] += xm;
            vy[i] += ym;
        }
         //   cout << join(vx," ") << endl;
          //  cout << join(vy," ") << endl;
        if(vx[0]+vy[0]>vec[0][0]){cout << "No" << endl;}
        else{
            int k = (vec[0][0]-(vx[0]+vy[0]));
            rep(i,n){
                vx[i] += k;
            }
            cout << "Yes" << endl;
            cout << join(vy," ") << endl;
            cout << join(vx," ") << endl;
        }
    }
    
}
