#include <bits/stdc++.h>

using namespace std;
 
typedef long long ll;
typedef long double ld;
 
typedef pair<ll, ll> pt;
 
#define MOD 1000000007

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int N;
	cin >> N;

	vector<vector<int> > C(N, vector<int>(N));

	for(int i = 0; i < N; i++) {
		for(int j = 0; j < N; j++) {
			cin >> C[i][j];
		}
	}

	int p;

	for(int i = 0; i < N; i++) {
		p = min_element(C[0].begin(), C[0].end()) - C[0].begin();
	}

	vector<int> A(N), B(N);

	for(int i = 0; i < N; i++) {
		A[i] = C[i][p];
	}

	for(int i = 0; i < N; i++) {
		B[i] = C[0][i] - C[0][p];
		for(int j = 1; j < N; j++) {
			if(C[j][i] - C[j][p] != B[i]) {
				cout << "No" << endl;
				return 0;
			}
		}
	}

	cout << "Yes" << endl;

	for(int i = 0; i < N; i++) cout << A[i] << " ";
	cout << endl;

	for(int i = 0; i < N; i++) cout << B[i] << " ";
	cout << endl;
}
// b.cpp

#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<(n);i++)
#define all(v) v.begin(),v.end()

template <typename T>
void chmin(T& a, T b) {if (b<a) a=b;}

int main() {
	int N;
	cin >> N;
	vector<vector<int>> C(N, vector<int>(N));
	int minC=1000000001, mini=-1, minj=-1;
	rep(i,N) rep(j,N) {
		cin >> C[i][j];
		if (C[i][j] < minC) {
			minC = C[i][j];
			mini=i; minj=j;
		}
	}
	vector<int> A(N), B(N);
	rep(i,N) A[i]=C[i][minj];
	rep(j,N) B[j]=C[mini][j]-C[mini][minj];
	bool exist = true;
	rep(i,N) rep(j,N) exist &= (C[i][j] == A[i] + B[j]);
	
	if (exist) {
		cout << "Yes" << endl;
		rep(i,N) cout << A[i] << " ";
		cout << endl;
		rep(i,N) cout << B[i] << " ";
		cout << endl;
	} else {
		cout << "No" << endl;
	}
}
