#include<bits/stdc++.h>
using namespace std;
int n;
int main()
{
	cin >> n; vector<vector<int> > C( n,vector<int>( n ) );
	vector<int> A( n ), B( n );
	for( auto &i:C )	for( auto &j:i )	cin >> j;
	int minval=numeric_limits<int>::max(),mini=0,minj=0;
	for( int i=0;i<n;++i )
	{
		for( int j=0;j<n;++j )
		{
			if( C[i][j]<minval )	minval=C[i][j],mini=i,minj=j;
		}
	}
	for( int i=0;i<n;++i )	B[i]=C[mini][i];
	for( int i=0;i<n;++i )
	{
		if( C[i][minj]-minval<0 )	exit( ( puts( "No" ),0 ) );
		A[i]=C[i][minj]-minval;
		for( int j=0;j<n;++j )
		{
			if( ( C[i][minj]-minval )^( C[i][j]-B[j] ) )	exit( ( puts( "No" ),0 ) );
		}
	}
	puts( "Yes" );
	for( int i:A )	cout << i << ' '; cout << "\n";
	for( int i:B )	cout << i << ' '; cout << "\n";
	return 0;
}
#include <bits/stdc++.h>
using namespace std;

int n;
vector<long long> a, b;
vector<vector<long long>> c;

bool solve();

int main() {
  cin >> n;
  c.resize(n);
  for (auto &v : c) {
    v.resize(n);
    for (auto &p : v) cin >> p;
  }
  if (solve()) {
    for (long long i = 0; i < n; ++i)
      for (long long j = 0; j < n; ++j) assert(c[i][j] == a[i] + b[j]);
    cout << "Yes" << endl;
    for (long long i = 0; i < n; ++i) cout << a[i] << " \n"[i == n - 1];
    for (long long i = 0; i < n; ++i) cout << b[i] << " \n"[i == n - 1];

  } else
    cout << "No" << endl;
  return 0;
}

bool solve() {
  {
    long long sum = 0;
    for (int i = 0; i < n; ++i) sum += c[i][i];
    for (int i = 0; i < n; ++i) {
      long long now = 0;
      for (int j = 0; j < n; ++j) now += c[(i + j) % n][j];
      if (now != sum) return 0;
    }
  }
  a.resize(n);
  b.resize(n);
  vector<vector<long long>> memo(n, vector<long long>(n, 0));
  vector<long long> sum(n);
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) sum[i] += c[i][j];
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) {
      if (abs(sum[i] - sum[j]) % n != 0) return 0;
      memo[i][j] = (sum[i] - sum[j]) / n;
    }
  for (int i = 0; i < n; ++i) {
    bool ch = 1;
    for (int j = 0; j < n; ++j)
      if (memo[i][j] > 0) ch = 0;
    if (ch) {
      b = c[i];
      for (int j = 0; j < n; ++j) a[j] = memo[j][i];
      return 1;
    }
  }
  return 0;
}