#include<bits/stdc++.h> 
using namespace std;
inline int read(){
    int res=0;
    char c;
    bool zf=0;
    while(((c=getchar())<'0'||c>'9')&&c!= '-');
    if(c=='-')zf=1;
    else res=c-'0';
    while((c=getchar())>='0'&&c<='9')res=(res<<3)+(res<<1)+c-'0';
    if(zf)return -res;
    return res;
}
const int maxn=505;
int c[maxn][maxn];
int a[maxn],b[maxn];
signed main(){
	int n=read();
	for(register int i=1;i<=n;++i){
		for(register int j=1;j<=n;++j){
			c[i][j]=read();
		}
	}
	int p=0;
	for(register int i=1;i<=n;++i){
		if(!p||c[i][1]<c[p][1]){
			p=i;
		}
	}
	for(register int i=1;i<=n;++i){
		a[i]=c[i][1]-c[p][1];
	}
	for(register int i=1;i<=n;++i){
		b[i]=c[i][i]-a[i];
	}
	for(register int i=1;i<=n;++i){
		if(a[i]<0||b[i]<0){
			puts("No");
			return 0;
		}
	}
	for(register int i=1;i<=n;++i){
		for(register int j=1;j<=n;++j){
			if(a[i]+b[j]!=c[i][j]){
				puts("No");
				return 0;
			}
		}
	}
	puts("Yes");
	for(register int i=1;i<=n;++i){
		printf("%d ",a[i]);
	}
	puts("");
	for(register int i=1;i<=n;++i){
		printf("%d ",b[i]);
	}
	puts("");
	return 0;
}
#include<bits/stdc++.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<iomanip>
#include<queue>
#include<cmath>
#include<stack>
#include<map> 
#define ll                   long long
#define skip                 cin>>ws;
#define vll                  vector<ll> 
#define vb                   vector<bool>
#define vpll                 vector<pair<ll,ll>>
#define vi                   vector<int>
#define vpi                  vector<pair<int, int>>
#define vvll                 vector<vector<ll>>
#define vvi                  vector<vector<int>>
#define vvvll                vector<vector<vector<ll>>>
#define pll                  pair<ll,ll>
#define vs                   vector<string>
#define vvpll                vector<vector<pair<ll, ll>>>
#define vvpi                 vector<vector<pair<int, int>>>
#define pb                   push_back
#define pob                  pop_back()
#define MOD                  (ll)(1e9 + 7)
#define MOD2                 (ll)(998244353)
#define INF                  (ll)(1e18 + 5)
#define count1(n)            __builtin_popcountll(n)
#define test                 ll t; cin>>t; while(t--)
#define all(x)               begin(x), end(x)

using namespace std;

void inline show(vll &a){for(ll e: a){if(e == INF) cout<<"INF ";else cout<<e<<" ";}cout<<"\n";}
void inline show(vi &a){for(int e: a){if(e == MOD) cout<<"MOD ";else cout<<e<<" ";}cout<<"\n";}

template<typename T> void enter(vector<T> &a){ for(T &e: a) cin>>e; } 

ll inline mo(ll a){ return a%MOD;}

ll inline po(ll x, ll y, ll p)
{
    ll res = 1; x = x % p;   
    while (y > 0) { if (y & 1) res = (res * x) % p; y >>= 1; x = (x * x) % p; } 
    return res%p; 
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    vll a(3);
    enter(a);

    sort(all(a));
    if(a[0] == a[1]) cout<<a[2]<<"\n";
    else if(a[2] == a[1]) cout<<a[0]<<"\n";
    else cout<<0<<"\n";

    return 0;
}   
