#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=513;
ll a[maxn][maxn];
ll ansa[maxn],ansb[maxn];
int main(){
	int n;
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			scanf("%lld",&a[i][j]);
		}
	}
	for(int i=2;i<=n;i++){
		int yes=1,ms=a[i][1]-a[i-1][1];
		for(int j=2;j<=n;j++){
			if(a[i][j]-a[i-1][j]!=ms){
				yes=0;
				break;
			}
		}
		if(!yes){
			return printf("No"),0;
		}
	}
	ll mn=1e18;
	int pos=0;
	for(int i=1;i<=n;i++){
		if(a[i][1]<mn) mn=a[i][1],pos=i;
	}
	for(int i=1;i<=n;i++) ansa[i]=a[pos][i];
	for(int i=1;i<=n;i++) ansb[i]=a[i][1]-a[pos][1];
	printf("Yes\n");
	for(int i=1;i<=n;i++) printf("%lld ",ansb[i]);
	puts("");
	for(int i=1;i<=n;i++) printf("%lld ",ansa[i]);
}
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep(i,a,n) for(int i=a;i<n;i++)
#define per(i,a,n) for(int i=a;i>=n;i--)
#define pb push_back
#define mp make_pair
#define mem(a,b) memset(a,b,sizeof(a))
ll gcd(ll a,ll b){if(b==0)return a;else return gcd(b,a%b);}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
const int maxn=500;
ll a[maxn+5][maxn+5];
int main()
{

    int n;
    cin>>n;
    rep(i,0,n)
    {
        rep(j,0,n)
        cin>>a[i][j];
    }
    bool flag=1;
    ll dif[n];
    rep(i,0,n)
    {
        dif[i]=a[i][0]-a[(i+1)%n][0];
    }
    rep(i,0,n)
    {
        rep(j,0,n)
        {
            ll tmp=a[i][j]-a[(i+1)%n][j];
            if(tmp!=dif[i])
            {
                cout<<"No"<<endl;
                return 0;
            }
        }
    }
    rep(i,0,n)
    {
        dif[i]=a[0][i]-a[0][(i+1)%n];
    }
    rep(i,0,n)
    {
        rep(j,0,n)
        {
            ll tmp=a[j][i]-a[j][(i+1)%n];
            if(tmp!=dif[i])
            {
                cout<<"No"<<endl;
                return 0;
            }
        }
    }
    cout<<"Yes"<<endl;
    ll min=0x3f3f3f3f3f3f3f3f;
    int minum=0;
    ll ans1[maxn+5];
    ll ans2[maxn+5];
    rep(i,0,n)
    {
        if(a[i][0]<min)
        {
            minum=i;
            min=a[i][0];
        }
    }
    rep(i,0,n)
    {
        ans2[i]=a[minum][i];
    }
    rep(i,0,n)
    {
        ans1[i]=a[i][0]-ans2[0];
    }
    rep(i,0,n)
    {
        cout<<ans1[i]<<" ";

    }
    cout<<endl;
    rep(i,0,n)
    {
        cout<<ans2[i]<<" ";
    }
    cout<<endl;
    return 0;
}