#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>

using namespace std;
using ll = long long;
using pint = pair<ll,ll>;

template<class T> ostream& operator<<(ostream& os, const vector<T> arr){ for(ll i = 0; i < (ll)arr.size(); i++)cout << arr[i] << (i == (ll)arr.size() -1 ? "" : " "); return os;}

bool check(vector<ll> A, vector<ll> B, vector<vector<ll>> C) {
	ll N = A.size();
	vector<vector<ll>> D(N, vector<ll>(N));
	for(ll i = 0; i < N; i++) {
		for(ll j = 0; j < N; j++)D[i][j] = A[i] + B[j];
	}
	return D == C;
}

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

	ll pos = 0;
	ll nin = 2e9;;

	for(ll i = 0; i < N; i++) {
		ll val = *min_element(C[i].begin(), C[i].end());
		if(val < nin) {
			nin = val;
			pos = i;
		}
	}


	vector<ll> B(N), A(N);
	for(ll i = 0; i < N; i++)B[i] = C[pos][i] - A[pos];
	for(ll i = 0; i < N; i++)A[i] = C[i][0] - B[0];


	if(!check(A, B, C)) {
		cout << "No" << endl;
		return 0;
	}
	cout << "Yes" << endl;
	cout << A << endl;
	cout << B << endl;
	



}
#include <bits/stdc++.h>
#define int long long
#define ri register int
#define N 505
using namespace std;
int n,p,q,a[N],b[N],c[N][N];
template <typename T> inline void read(T &x) {
	register T f=0,c=getchar();
	for (; c<48||57<c; c=getchar()) if (c=='-') f=1;
	for (x=0; 48<=c&&c<=57; c=getchar()) x=(x<<3)+(x<<1)+(c&15);
	if (f) x=~(--x);
}
template <typename T> inline void print(T x) {
	if (x<0) putchar('-'),x=~(--x);
	if (x>9) print(x/10);
	putchar(x%10|48);
}
signed main() {
	read(n);
	for (ri i=1; i<=n; ++i)
		for (ri j=1; j<=n; ++j) read(c[i][j]);
	for (ri i=2; i<=n; ++i) a[i]=c[i][1]-c[1][1];
	for (ri i=2; i<=n; ++i)
		for (ri j=2; j<=n; ++j)
			if (c[j][i]-c[1][i]!=a[j]) return puts("No"),0;
	for (ri i=2; i<=n; ++i) b[i]=c[1][i]-c[1][1];
	for (ri i=2; i<=n; ++i)
		for (ri j=2; j<=n; ++j)
			if (c[i][j]-c[i][1]!=b[j]) return puts("No"),0;
	for (ri i=2; i<=n; ++i)
		if (a[i]<0&&p>a[i]) p=a[i];
	for (ri i=2; i<=n; ++i)
		if (b[i]<0&&q>b[i]) q=b[i];
	if (c[1][1]+p+q<0) return puts("No"),0;
	puts("Yes"),print(a[1]=-p),putchar(' ');
	for (ri i=2; i<=n; ++i) print(a[i]+a[1]),putchar(' ');
	puts(""),print(b[1]=c[1][1]+p),putchar(' ');
	for (ri i=2; i<=n; ++i) print(b[i]+b[1]),putchar(' ');
	return 0;
}