#include<iostream>
#include<cstdio>
using namespace std;
const int N=2021,INF=2e9;
int n,a[N],b[N],c[N][N];
int read(){
	int x=0,f=1; char ch=getchar();
	while(ch<'0' || ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0' && ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
int main()
{
	n=read();
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)c[i][j]=read();
	for(int i=2;i<=n;i++)
		b[i]=c[1][i]-c[1][i-1],a[i]=c[i][1]-c[i-1][1];
	int mib=INF,mia=INF;
	for(int i=2;i<=n;i++)
		b[i]+=b[i-1],a[i]+=a[i-1],mib=min(mib,b[i]),mia=min(mia,a[i]);
	b[1]=max(0,-mib); a[1]=max(0,-mia);
	if(b[1]+a[1]>c[1][1])return puts("No"),0;
	else a[1]=c[1][1]-b[1];
	for(int i=2;i<=n;i++)
		b[i]+=b[1],a[i]+=a[1];
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			if(c[i][j]!=a[i]+b[j])
				return puts("No"),0;
	puts("Yes");
	for(int i=1;i<=n;i++)cout<<a[i]<<" ";cout<<endl;
	for(int j=1;j<=n;j++)cout<<b[j]<<" ";cout<<endl;
	return 0;
}
// 2021-03-21 20:11:03
// clang-format off
#include <bits/stdc++.h>
#ifdef LOCAL
#include "lib/debug.hpp"
#else
#define debug(...) 1
#endif
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define rep(i, n) REP(i, 0, (n))
#define repc(i, n) REPC(i, 0, (n))
#define REP(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define REPC(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define REPCM(i, n, m) for (int i = (int)(n); i >= (int)(m); i--)
template<class T> inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } else return false; }
template<class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } else return false; }
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;

// clang-format on
void answer() {
  int n;
  cin >> n;
  vector<vector<int> > c(n, vector<int>(n, 0));
  rep(i, n) rep(j, n) cin >> c[i][j];
  vector<int> d(n, 0);
  rep(i, n - 1) {
    int diff = c[i + 1][0] - c[0][0];
    REP(j, 1, n) {
      if (c[i + 1][j] - c[0][j] != diff) {
        cout << "No" << '\n';
        return;
      }
    }
    d[i + 1] = diff;
  }
  cout << "Yes" << '\n';
  int mind = 0;
  rep(i, n) chmin(mind, d[i]);
  rep(i, n) {
    if (i) cout << ' ';
    cout << d[i] - mind;
  }
  cout << '\n';
  rep(i, n) {
    if (i) cout << ' ';
    cout << c[0][i] - d[0] + mind;
  }
  cout << '\n';
}

int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  answer();
  return 0;
}