#include<bits/stdc++.h>
using namespace std;
#define int long long
int n,m;
const int N=505;//点数
const int M=5e5+5;//边数 
int End[M],Last[N],Next[M],Len[M],e;//链式前向星
void add_edge(int x,int y,int z)
{
	End[++e]=y;
	Next[e]=Last[x];
	Last[x]=e;
	Len[e]=z;
}
int dis[N],cnt[N];//cnt记录各个点入队次数 
queue<int> q;
bool inq[N];//inq标记各个点是否在队列中 
bool spfa(int s)
{
	for(int i=1;i<=n;i++) dis[i]=-1e9;//最短路，初始值为inf
	dis[s]=0;
	for(int i=1;i<=n;i++)//全部放入队列
	{
		q.push(i);
		inq[i]=true;
		cnt[i]++;
	}
	while(q.size())
	{
		int x=q.front();
		q.pop();
		inq[x]=false;
		for(int i=Last[x];i;i=Next[i])
		{
			int y=End[i];
			if(dis[y]<dis[x]+Len[i])
			{
				dis[y]=dis[x]+Len[i];
				if(!inq[y])
				{
					q.push(y);
					inq[y]=true;
					cnt[y]++;
					if(cnt[y]>n+1) return false;//返回 false，意味着无解
				}
			}
		}
	}
	return true;
}
int s[N],pd[N][N],c[N][N],y[N];
signed main()
{
	cin>>n;
		for(int i=1;i<=n;i++){
	 	for(int k=1;k<=n;k++){
	 		cin>>c[i][k];
	 		s[i]+=c[i][k];
		 }
	 }
	 for(int i=1;i<=n;i++)add_edge(0,i,0);
	 for(int i=1;i<=n;i++){
	 	for(int k=i;k<=n;k++){
	 		if(i==k)continue;
	 		//if(s[i]-s[k]<0)continue;
	 		if(pd[i][k])continue;
	 		if((s[i]-s[k])%n!=0){
	 			puts("No");
	 			return 0;
			 }
			 add_edge(i,k,-(s[i]-s[k])/n);
			 add_edge(k,i,-(s[k]-s[i])/n);
			 pd[i][k]=pd[k][i]=1;
		 }
	 }
/*	for(int i=1;i<=m;i++)
	{
		int x,y,z;
		scanf("%d%d%d",&x,&y,&z);
		add_edge(y,x,z);
	}*/
	if(spfa(1))
	{
		
		int minn=1e9;
		int maxx=-1e9;
		for(int i=1;i<=n;i++){
			minn=min(minn,dis[i]);
			maxx=max(maxx,dis[i]);
		}
		for(int i=1;i<=n;i++){
			dis[i]-=minn;
		}
		for(int i=1;i<=n;i++){
			y[i]=c[1][i]-dis[1];
		}
		for(int i=1;i<=n;i++){
			for(int k=1;k<=n;k++)
				if(c[i][k]-dis[i]!=y[k]){
					puts("No");
					return 0;
				}
		}
		puts("Yes");
		for(int i=1;i<=n;i++)printf("%lld ",dis[i]);
		puts("");
		for(int i=1;i<=n;i++)printf("%lld ",y[i]);
	//	for(int i=1;i<=n;i++) printf("%d%c",dis[i],i<n?' ':'\n');
	}
	else printf("No\n");
	return 0;
}

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#ifndef aa
#define trace(...)
#define endl '\n'
#endif
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define fi first
#define se second
#define int long long
typedef long long ll;
typedef long double ld;
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sz(x) ((long long)x.size())
#define fr(a,b,c) for(int a=b; a<=c; a++)
#define frev(a,b,c) for(int a=c; a>=b; a--)
#define rep(a,b,c) for(int a=b; a<c; a++)
#define trav(a,x) for(auto &a:x)
#define all(con) con.begin(),con.end()
#define done(x) {cout << x << endl;return;}
#define mini(x,y) x=min(x,y)
#define maxi(x,y) x=max(x,y)
const ll infl = 0x3f3f3f3f3f3f3f3fLL;
const int infi = 0x3f3f3f3f;
mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());
//const int mod = 998244353;
const int mod = 1e9 + 7;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vector<int>> vvi;
typedef vector<pair<int, int>> vpii;
typedef map<int, int> mii;
typedef set<int> si;
typedef set<pair<int,int>> spii;
typedef queue<int> qi;
uniform_int_distribution<int> rng(1,1e5);
uniform_int_distribution<int> rng1(0,1);
uniform_int_distribution<int> rng2(1,5e4);

//DEBUG FUNCTIONS START
#define cerr cout
void __print(int x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
//#define deb(x...) cerr << "[" << #x << "] = "; _print(x)
#define deb(x...)  _print(x)
#else
#define deb(x...)
#endif
// DEBUG FUNCTIONS END



const int N = 2e5 + 5;



void solve(){
	
	
	int n;
	cin >> n;
	vvi c(n, vi(n));
	vi a(n), b(n);
	
	rep(i,0,n){
		rep(j,0,n){
			cin >> c[i][j];
		}
		a[i] = c[i][0];
	}
	
	rep(j,0,n){
		b[j] = c[0][j] - a[0];
	}
	
	rep(i,0,n){
		rep(j,0,n){
			if(c[i][j] != a[i] + b[j])
				done("No");
		}
	}
	
	int x = 0;
	int y = *min_element(all(a));
	if(y < 0)
		x = -y;
	y = *min_element(all(b));
	if(y < 0)
		x = y;
	
	cout << "Yes" << endl;
	rep(i,0,n)
		cout << a[i] + x << ' ';
	cout << endl;
	rep(i,0,n)
		cout << b[i] - x << ' ';
	
}





signed main() {
	
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cout << fixed << setprecision(15);
    int t = 1;
    //cin >> t;
    while (t--)
        solve();
    return 0;
}

int powm(int a, int b){
    int res = 1;
    while (b) {
        if (b & 1)
            res = res * a % mod;
        a = a * a % mod;
        b >>= 1;
    }
    return res;
}

int divide(int a, int b) {
    return (a % mod) * powm(b % mod, mod - 2) % mod;
}
