#include <bits/stdc++.h>

#define reint int
#define coint const int

using namespace std;

typedef long long ll;

coint SIZE = 500 + 5;

int n;
ll li[SIZE][SIZE];
ll deltA[SIZE], deltB[SIZE];

int main(void) {
    scanf("%d", &n);
    for (reint i = 1; i <= n; ++i)
        for (reint j = 1; j <= n; ++j)
            scanf("%lld", &li[i][j]);
    for (reint i = 2; i <= n; ++i)
        deltB[i] = li[1][i] - li[1][i - 1];
    for (reint i = 2; i <= n; ++i)
        deltA[i] = li[i][1] - li[i - 1][1];
    ll minA = 0, minB = 0;
    for (reint i = 1; i <= n; ++i) {
        deltA[i] += deltA[i - 1];
        deltB[i] += deltB[i - 1];
        minA = min(minA, deltA[i]);
        minB = min(minB, deltB[i]);
    }
    if (-(minA + minB) > li[1][1]) {
        puts("No");
        return 0;
    }
    deltA[1] = -minA, deltB[1] = li[1][1] - deltA[1];
    for (reint i = 2; i <= n; ++i)
        deltA[i] += deltA[1], deltB[i] += deltB[1];

    int flg = 1;
    for (reint i = 1; i <= n && flg; ++i)
        for (reint j = 1; j <= n && flg; ++j)
            if (deltA[i] + deltB[j] != li[i][j])
                flg = 0;
    if (!flg) {
        puts("No");
    } else {
        puts("Yes");
        for (reint i = 1; i <= n; ++i)
            printf("%lld%c", deltA[i], " \n"[i == n]);
        for (reint i = 1; i <= n; ++i)
            printf("%lld%c", deltB[i], " \n"[i == n]);
    }
    return 0;
}

#include <bits/stdc++.h>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int n;
vector<int> pr;
vector<int> ans;
bool prime[10001];
bool used[10001];

void dfs(int v,int sum){
	if(ans.size()==n)return;
	if(v==pr.size())return;
	//printf("%d %d %d\n",v,sum,pr[v]);
	int ko=pr[v];
	while(sum*ko<=10000 && !used[sum*ko]){
		if(v==pr.size())return;
		ans.push_back(sum*ko);
		used[sum*ko]=true;
		dfs(v+1,sum*ko);
		ko*=pr[v];
	}
	dfs(v+1,sum);
}

int gcd(int a,int b){
	if(b==0)return a;
	return gcd(b,a%b);
}

int main(void){
	scanf("%d",&n);
	memset(prime,true,sizeof(prime));
	for(int i=2;i<=5000;i++){
		if(prime[i]){
			pr.push_back(i);
			for(int j=i*2;j<=5000;j+=i){
				prime[j]=false;
			}
		}
	}
	for(int i=0;i<(1<<3);i++){
		int cnt=0;
		int res=1;
		for(int j=0;j<3;j++){
			if((i>>j) & 1){
				cnt++;
				res*=pr[j];
			}
		}
		if(cnt!=2)continue;
		ans.push_back(res);
		used[res]=true;
	}
	for(int i=0;i<3;i++){
		dfs(0,ans[i]);
	}
	for(int i=0;i<n;i++){
		printf("%d%c",ans[i],i+1==n?'\n':' ');
	}
	return 0;
}
