#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define all(v) v.begin(), v.end()
#define chmax(x,y) (x = max(x,y))
#define chmin(x,y) (x = min(x,y))
#define FOR(i,x,n) for(int i=x;i<(n);i++)

using ll = long long;
using PAIR = pair<int, int>;
using PAIRLL = pair<ll,ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vc = vector<char>;
using vvc = vector<vc>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vll = vector<ll>;
using vvll = vector<vll>;
using Graph = vector<vector<int>>;
ll INF = 10000000000;
int main()
{
  ll N;
  cin >> N;
  vvll C(N,vll(N));
  ll MIN_h = INF, MIN_w = INF,MIN = INF;
  rep(i,N)
  {
    rep(j,N)
    {
      cin >> C[i][j];
      if(MIN>C[i][j])
      {
        chmin(MIN, C[i][j]);
        MIN_h = i;
        MIN_w = j;
      }
    }
  }
  bool check = true;
  vll mem(N);
  ll temp1 = INF;
  rep(i,N)
  {
    chmin(temp1, C[0][i]);
  }
  rep(i,N)
  {
    mem[i] = C[0][i] - temp1;
  }
  rep(i,N)
  {
    rep(j,N-1)
    {
      if(C[i][j+1]!=C[i][j]+mem[j+1]-mem[j])
        check = false;
    }
  }
  vvll ans(N, vll(N));
  if(check)
  {
    cout << "Yes" << endl;
    vll A(N), B(N);
    rep(i,N)
    {
      A[i] = C[i][MIN_w] - MIN;
    }
    rep(i,N)
    {
      B[i] = C[MIN_h][i];
    }
    rep(i,N)
    {
      cout << A[i];
      if(i!=N-1)
        cout << " ";
    }
    cout << endl;
    rep(i, N)
    {
      cout << B[i];
      if (i != N - 1)
        cout << " ";
    }
    cout << endl;
  }
  else
  {
    cout << "No" << endl;
  }

}

#include <bits/stdc++.h>
using namespace std;
const int N=510;
int a[N],c[N][N],d[N][N];
int main() 
{
	int n; 
	cin>>n;
	memset(a,0x3f,sizeof(a));
	for(int i=1;i<=n;i++) 
		for(int j=1;j<=n;j++)
		{
			cin>>c[i][j];
			a[i]=min(a[i],c[i][j]);
			d[i][j]=c[i][j]-c[i][1];
		}
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			if(d[i][j]!=d[1][j]) 
			{
				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<<c[1][i]-a[1]<<' ';
    return 0;
}