#include<iostream>
#include<sstream>
#include<iomanip>
#include<cstdlib>
#include<algorithm>
#include<vector>
#include<map>
#include<cmath>
#include<string>
#include<numeric>
#include<queue>


#define rep(i,p) for(long long int i=0;i<p;i++)
#define reep(i,p) for(long long int i=1;i<=p;i++)
#define ll long long
#define MOD 1000000007
#define INF 9223372036854775800

using namespace std;

int main(){

ll int N;
cin >> N;
vector< vector < ll int > > C(N,vector< ll int > (N) );
ll int Su=0;
rep(i,N){
	rep(j,N){
		cin >> C[i][j];
		Su += C[i][j];

	}
}


vector< vector < ll int > > kari;
vector< ll int > A(N);
vector< ll int > B(N);
//cout << Su << endl << endl;
/*
rep(i,100){
	ll int sum = 0;
	A[0] = i;
	rep(j,N){
		B[j] = C[0][j] - A[0];
		sum += B[j] * N;
	}
	rep(j,N){
		A[j] = C[j][0] - B[j];
		sum += A[j] * N;
	}
	rep(j,N){
		cout << sum << endl;
	}
}
*/
rep(i,N){
	rep(k,N){
	ll int sum = 0;
	A[i] = 0;
	rep(j,N){
		B[j] = C[i][j] - A[i];
		sum += B[j] * N;
	}
	rep(j,N){
		A[j] = C[j][k] - B[k];
		sum += A[j] * N;
	}
	//	cout << sum << endl;
		if( sum == Su ){
			A[0] = A[0] - (*min_element(A.begin(),A.end()));
			rep(j,N){
				B[j] = C[0][j] - A[0];
				sum += B[j] * N;
			}
			rep(j,N){
				A[j] = C[j][0] - B[0];
				sum += A[j] * N;
			}
			rep(a,N){
				rep(b,N){
					if( C[a][b] != A[a] + B[b] ){
						cout << "No" << endl;
						return 0;
					}
				}
			}
			cout << "Yes" << endl;
			rep(j,N-1){
				cout << A[j] << " ";
			}
			cout << A[N-1] << endl;
			rep(j,N-1){
				cout << B[j] << " ";
			}
			cout << B[N-1] << endl;
			return 0;
		}


//	rep(j,N){
//		cout << A[0] - (*min_element(A.begin(),A.end())) << " " <<
//			A[0] + (*min_element(B.begin(),B.end())) << endl;
//	}
//	cout << endl;
}
}

cout << "No" << endl;
	







	return 0;

}


#include <bits/stdc++.h>
using namespace std;
#define int long long
const int MAXN = 5e2 + 50;
int diffa[MAXN], diffb[MAXN];
int a[MAXN], b[MAXN], c[MAXN][MAXN];
bool check(int n) {
    for (int i = 1; i <= n; ++i)
        for (int j = 1; j <= n; ++j)
            if (a[i] + b[j] != c[i][j] || a[i] < 0 || b[j] < 0)
                return false;
    return true;
}
signed main(/*int argc, char *argv[]*/) {
    //ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int n;
    cin >> n;
    for (int i = 1; i <= n; ++i)
        for (int j = 1; j <= n; ++j)
            cin >> c[i][j];
    int mn1 = 0x3f3f3f3f, res1 = 0, mn2 = 0x3f3f3f3f, res2 = 0;
    for (int i = 2; i <= n; ++i) diffb[i] = c[1][i] - c[1][i - 1], res1 += diffb[i], mn1 = min(mn1, res1);
    for (int i = 2; i <= n; ++i) diffa[i] = c[i][1] - c[i - 1][1], res2 += diffa[i], mn2 = min(mn2, res2);
    for (int i = 2; i <= n; ++i) {
        for (int j = 2; j <= n; ++j) {
            if (c[i][j] - c[i][j - 1] != diffb[j]) {
                puts("No");
                system("pause");
                return 0;
            }
        }
    }
    //cout << mn1 << ' ' << mn2 << '\n';
    for (int i = -mn2; i <= c[1][1] + mn1; ++i) {
        a[1] = i, b[1] = c[1][1] - a[1];
        //if (b[1] - mn1 < 0) break;
        for (int i = 2; i <= n; ++i) a[i] = a[i - 1] + diffa[i], b[i] = b[i - 1] + diffb[i];;
        if (check(n)) {
            puts("Yes");
            for (int i = 1; i <= n; ++i) cout << a[i] << " \n"[i == n];
            for (int i = 1; i <= n; ++i) cout << b[i] << " \n"[i == n];
            system("pause");
            return 0;
        }
    }
    puts("No");
    system("pause");
    return 0;
}