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

int n;
int a[550][550];
int b[550], c[550];

int main(){
    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    cin >> n;
    for (int i = 1; i <= n; i += 1){
        for (int j = 1; j <= n; j += 1){
            cin >> a[i][j];
        }
    }
    bool flag = true;
    for(int i = 2; i <= n; i++){
        for(int j = 2; j <= n; j++){
            if(a[i][j] - a[i][j - 1] != a[i - 1][j] - a[i - 1][j - 1]) flag = false;
        }
    }

    for(int j = 2; j <= n; j++){
        for(int i = 2; i <= n; i++){
            if(a[i][j] - a[i - 1][j] != a[i][j - 1] - a[i - 1][j - 1]) flag = false;
        }
    }
    if(!flag){
        cout << "No\n";
    }
    else{
        int index = 1;
        for(int i = 1; i <= n; i++){
            if(a[i][1] < a[index][1]) index = i;
        }
        for(int i = 1; i <= n; i++){
            c[i] = a[index][i];
        }
        for (int i = 1; i <= n; i += 1){
            b[i] = a[i][1] - c[1];
        }
        cout << "Yes\n";
        for (int i = 1; i <= n; i += 1){
            cout << b[i] << " \n"[i == n];
        }
        for (int i = 1; i <= n; i += 1){
            cout << c[i] << " \n"[i == n];
        }
    }
    return 0;
}

#include <bits/stdc++.h>
#define INF 0x3f3f3f3f
#define rep(i, a, n) for (int i=(a); i<(n); i++)
#define per(i, a, n) for (int i=(a); i>(n); i--)
typedef long long ll;
const int maxn = 1e3+5;
const int mod = 1e9+7;
using namespace std;

ll mp[maxn][maxn];

void solve() {
	int n; cin >> n;
	ll k = 1e18;
	bool ok = 1;
	vector<ll> a(n), b(n);
	rep(i,0,n) rep(j,0,n) cin >> mp[i][j];
	rep(i,0,n) k = min(k, mp[0][i]);
	rep(i,0,n) {
		b[i] = mp[0][i] - k;
		if (b[i] < 0) {
			ok = 0;
			break;
		}
	}
	a[0] = k;
	rep(i,1,n) {
		a[i] = mp[i][0] - b[0];
		if (a[i] < 0) {
			ok = 0;
			break;
		}
		rep(j,0,n) {
			if (a[i] + b[j] != mp[i][j]) {
				ok = 0;
				break;
			}
		}
	}
	if (ok) {
		cout << "Yes\n";
		rep(i,0,n) cout << a[i] << " \n"[i==n-1];
		rep(i,0,n) cout << b[i] << " \n"[i==n-1];
	} else cout << "No\n";
}

int main(int argc, char * argv[]) {
	ios_base::sync_with_stdio(false); cin.tie(0);
	//int t; cin >> t; while(t--)
	solve();

    return 0;
}