// B - Plus Matrix
#include <bits/stdc++.h>
using namespace std;
#define vec vector
using vi = vec<int>;
#define rep(i,e) for(int i=0;i<(e);++i)

int main(){
	int n; cin>>n;
	vec<vi> C(n, vi(n)); rep(i, n) rep(j, n) cin>>C[i][j];
	vi B(n, 1e9), A(n, 0);
	rep(i, n) rep(j, n) B[i] = min(B[i], C[j][i]);
	rep(i, n){
		rep(j, n) A[i] = max(A[i], C[i][j] - B[j]);
		B[i] = C[i][i] - A[i];
	}
	rep(i, n) rep(j, n) if(A[i] + B[j] != C[i][j]){ puts("No"); return 0; }
	puts("Yes");
	rep(i, n) cout<< A[i] <<(i<n-1? " ":"\n");
	rep(i, n) cout<< B[i] <<(i<n-1? " ":"\n");
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i,a,b) for(int i=a;i<=b;i++)
inline ll r() {
	ll x=0,f=1;
	char c=getchar();
	while(!isdigit(c)){if(c=='-')f=-1;c=getchar();}
	while(isdigit(c))x=x*10+c-'0',c=getchar();
	return x*f;
}
#define d r()
ll n,tmp,k;
int main(){
	n=d;
	if(n==0){
		cout<<0;
		return 0;
	}
	if(n==2){
		cout<<1;
		return 0;
	}
	ll k=max((ll)0,(ll)sqrt(2*n+2)-100);
	tmp=(1+k)*k/2;
	while(1){
		if(tmp>n+1)break;
		k++;
		tmp+=k; 
	}
	k--;
	cout<<n-k+1;
	return 0;
}
