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

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    int C[N][N];
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
            cin >> C[i][j];
        }
    }
    int A[N], B[N];
    A[0] = B[0] = 0;
    int min_a = 0;
    for (int i = 1; i < N; i++) {
        int ok = C[0][i] - C[0][0];
        for (int j = 0; j < N; j++) {
            if (C[j][i] - C[j][0] != ok) {
                cout << "No\n";
                return 0;
            } 
        }
        A[i] = ok;
        min_a = min(min_a, ok);
    }
    int min_b = 0;
    for (int i = 1; i < N; i++) {
        int ok = C[i][0] - C[0][0];
        for (int j = 0; j < N; j++) {
            if (C[i][j] - C[0][j] != ok) {
                cout << "No\n";
                return 0;
            } 
        }
        B[i] = ok;
        min_b = min(min_b, ok);
    }
    for (int i = 0; i < N; i++) A[i] -= min_a;
    for (int i = 0; i < N; i++) B[i] -= min_b;
    int diff = C[0][0] - A[0] - B[0];
    if (diff < 0) {
        cout << "No\n";
        return 0;
    }
    cout << "Yes\n";
    for (int i = 0; i < N; i++) {
        if (i) cout << " ";
        cout << B[i] + diff;
    }
    cout << "\n";
    for (int i = 0; i < N; i++) {
        if (i) cout << " ";
        cout << A[i];
    }
    cout << "\n";
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int,int>;
#define rep(i,n) for(int i=0; i<(int)n; i++)
#define llrep(i,n) for(ll i=0; i<(ll)n; i++)
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()) //sortしてから使う
#define INF 2147483647
#define LLINF 9223372036854775807LL
#define PI (double)3.14159265358979323846;
#define fi first
#define se second
#define kiriage(x,y) (((x)+(y)-1)/(y))
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vp;

int main(){
	int n; cin>>n;
	int c[n][n];
	rep(i,n) rep(j,n) cin>>c[i][j];
	vi M(n);
	rep(i,n){
		int mn = INF;
		rep(j,n){
			mn = min(c[j][i], mn);
		}
		M[i] = mn;
	}
	vi ans(n);
	rep(i,n){
		int dif = c[i][0] - M[0];
		rep(j,n){
			if (dif != c[i][j] - M[j]){
				cout << "No" << endl;
				return 0;
			}
		}
		ans[i] = dif;
	}
	cout << "Yes" << endl;
	rep(i,n) cout << ans[i] << " ";
	cout << endl;
	rep(i,n) cout << M[i] << " ";
}