#include <bits/stdc++.h>
#define endl '\n'
#define INF 0x3f3f3f3f
#define Inf 1000000000000000000LL
#define int long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
using namespace std;
typedef pair<int,int>pii;
int n;
int c[510][510];
int sumr[510],sumc[510];
int a[510],b[510];
bool check(){
	for(int i=1;i<=n;i++)if(a[i]<0)return 0;
	for(int i=1;i<=n;i++)if(b[i]<0)return 0;
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++){
			if(c[i][j]!=a[i]+b[j])return 0;
		}
	return 1;
}
signed main(){
	cin>>n;
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++){
			cin>>c[i][j];
			sumr[i]+=c[i][j];
			sumc[j]+=c[i][j];
		}
	int mn1=INF,mn2=INF;
	for(int i=1;i<=n;i++)mn1=min(mn1,c[i][1]);
	for(int i=1;i<=n;i++)mn2=min(mn2,c[1][i]);
	for(int i=1;i<=n;i++)a[i]=c[i][1]-mn1;
	for(int i=1;i<=n;i++)b[i]=c[1][i]-mn2;
	int ex=c[1][1]-a[1]-b[1];
//	cout<<ex<<endl;
//	for(int i=1;i<=n;i++)cout<<a[i]<<' ';
//	puts("");
//	for(int i=1;i<=n;i++)cout<<b[i]<<' ';
//	puts("");
	if(ex<0){
		puts("No");
		return 0;
	}
	for(int i=1;i<=n;i++)b[i]+=ex;
	if(!check()){
		puts("No");
		return 0;
	}
	puts("Yes");
	for(int i=1;i<=n;i++)cout<<a[i]<<' ';
	puts("");
	for(int i=1;i<=n;i++)cout<<b[i]<<' ';
	puts("");
	return 0;
}
/*
a1+b1		a1+b2		a1+b3
a2+b1		a2+b2		a2+b3
a3+b1		a3+b2		a3+b3
sumall=3*(a1+a2+a3+b1+b2+b3)
sumr1=12=3*a1+b1+b2+b3
sumr2=6=3*a2+b1+b2+b3
sumr3=9=3*a3+b1+b2+b3
sumc1=3*b1+a1+a2+a3
a2-a1=(sumr2-sumr1)/3
a3-a2=(sumr3-sumr2)/3

2 0 1
1 0 2
*/

#include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<string>
#include<unordered_map>
#include <iomanip>
using namespace std;

#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j,k
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define sort(a) sort(a.begin(),a.end())
#define push(a,b) (a).push_back(b)
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define sizeoof(a,b) (a,vector<ll>(b))
#define llpvec vector<pair<ll,ll>>
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*最小公倍数*/ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
/*n乗*/ll llpow(ll x,ll n){ll i,ans=1;rep(i,0,n)ans*=x;return ans;}
/*階乗*/ll fact(ll x){ll i,ans=1;rep(i,0,x)ans*=(x-i);return ans;}
/*nCr*/ll ncr(ll n,ll r){return fact(n)/fact(r)/fact(n-r);}
/*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);}
/*primejudge*/bool prime(ll a){if(a<=1)return false;ll i;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
ll ans=0;llfor;///////////////////////////////////////////////////////////
int digit(int n){
   if(n < 10)  return n;
   return digit(n/10) + n%10;
}
int GetDigit(ll num){
    return std::to_string(num).length();
}

int main(){
  int N;
  cin>>N;
  vector<vector<int>> data(N, vector<int>(N));

    for (int j = 0; j < N; j++) {
      cin >> data.at(0).at(j);
    }

    vector<int> V(N);
    for(int i=0;i<N-1;i++){
      V[i]=data.at(0).at(i+1)-data.at(0).at(i);
    }
  bool flag=false;
  for (int i = 1; i < N; i++) {
    for (int j = 0; j < N; j++) {
      cin >> data.at(i).at(j);
      if(j!=0 && data.at(i).at(j-1)+V[j-1]!=data.at(i).at(j)) flag=true;
    }
  }

  if(flag) cout<<"No"<<endl;
  else{
    vector<int> V(N);
    int M=1000000007;
    for(int i=0;i<N;i++){
      V[i]=data.at(i).at(0)-data.at(0).at(0);
      M=min(M,V[i]);
    }
    for(int i=0;i<N;i++){
      V[i]-=min(M,0);
    }
    flag=false;
    for(int i=0;i<N;i++){
      data.at(0).at(i)+=min(M,0);
      if(data.at(0).at(i)<0) flag=true;
    }
    if(flag) cout<<"No"<<endl;
    else{
      cout<<"Yes"<<endl;
      for(int i=0;i<N;i++){
        cout<<V[i]<<" ";
      }
      cout<<endl;
      for(int i=0;i<N;i++){
        cout<<data.at(0).at(i)<<" ";
      }
    }
  }


return 0;}
