#include<bits/stdc++.h>
#define re register
using namespace std;
inline int read(){
	re int t=0;re char v=getchar();
	while(v<'0')v=getchar();
	while(v>='0')t=(t<<3)+(t<<1)+v-48,v=getchar();
	return t;
}
const int M=998244353;
inline void add(re int &x,re int y){(x+=y)>=M?x-=M:x;}
inline int ksm(re int x,re int y){
	re int s=1;
	while(y){
		if(y&1)s=1ll*s*x%M;
		x=1ll*x*x%M,y>>=1;
	}
	return s;
}
int n,f[502][502],a[502],b[502],px;
signed main(){
	n=read();
	re int mn=2e9;
	for(re int i=1;i<=n;++i)for(re int j=1;j<=n;++j)f[i][j]=read(),mn=min(mn,f[i][j]);
	for(re int i=1;i<=n;++i){
		for(re int j=1;j<=n;++j){
			if(f[i][j]==mn){
				px=i;
			}
		}
	}
	for(re int i=1;i<=n;++i)b[i]=f[px][i]-mn;
	for(re int i=1;i<=n;++i){
		for(re int j=1;j<=n;++j){
			a[i]=f[i][j]-b[j];
		}
	}
	for(re int i=1;i<=n;++i)if(a[i]<0)return puts("No"),0;
	for(re int i=1;i<=n;++i)for(re int j=1;j<=n;++j)if(a[i]+b[j]!=f[i][j])return puts("No"),0;
	puts("Yes");
	for(re int i=1;i<=n;++i)printf("%d ",a[i]);puts("");
	for(re int i=1;i<=n;++i)printf("%d ",b[i]);puts("");
}

#include <sstream>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <array>
#include <deque>
#include <numeric>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <list>
#include <cassert>
#include <cmath>
#include <climits>
#include <map>
#include <queue>
#include <functional>
#include <bitset>
#include <cassert>
using namespace std;
using ll = int64_t;
#define rep(i, a) for (int i = 0; i < (int)(a); ++i)
#define rep2(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define repr(i, a) for (int i = (int)((a) - 1); i >= 0; --i)
template <class T> class V1 : public vector<T> { public: V1(size_t n1, T init = T()) : vector<T>(n1, init) {} };
template <class T> class V2 : public vector<V1<T>> { public: V2(size_t n1, size_t n2, T init = T()) : vector<V1<T>>(n1, V1<T>(n2, init)) {} };
template <class T> class V3 : public vector<V2<T>> { public: V3(size_t n1, size_t n2, size_t n3, T init = T()) : vector<V2<T>>(n1, V2<T>(n2, n3, init)) {} };
template <class T> class V4 : public vector<V3<T>> { public: V4(size_t n1, size_t n2, size_t n3, size_t n4, T init = T()) : vector<V3<T>>(n1, V3<T>(n2, n3, n4, init)) {} };
template <class T> class V5 : public vector<V4<T>> { public: V5(size_t n1, size_t n2, size_t n3, size_t n4, size_t n5, T init = T()) : vector<V4<T>>(n1, V4<T>(n2, n3, n4, n5, init)) {} };
template <class T> vector<T> GetV1(istream& in, size_t N) { vector<T> ret; ret.reserve(N); rep(i, N) { T a; in >> a; ret.emplace_back(a); } return ret; }
struct dstream { ofstream fout; dstream(const char* fname) : fout(fname) {} };
template <typename T> dstream& operator << (dstream& lhs, const T& rhs) { lhs.fout << rhs; cout << rhs; return lhs; }

int main()
{
#ifdef ENV_LOCAL
	ifstream fin("input.txt");
	dstream dout("output.txt");
	auto& in = fin;
	auto& out = dout;
#else
	auto& in = cin;
	auto& out = cout; out << "";
#endif

	int N;
	in >> N;
	V2<ll> c(N, N);
	rep(i, N) {
		rep(j, N) {
			in >> c[i][j];
		}
	}
	ll min1 = LLONG_MAX;
	int imin = -1;
	rep(i, N) {
		if (c[0][i] < min1) {
			min1 = c[0][i];
			imin = i;
		}
	}
	vector<ll> As(N), Bs(N);
	rep(i, N) {
		As[i] = c[i][imin];
	}
	rep(j, N) {
		Bs[j] = c[0][j] - As[0];
		rep2(i, 1, N) {
			ll b = c[i][j] - As[i];
			if (b != Bs[j]) {
				cout << "No";
				return 0;
			}
		}
	}
	cout << "Yes" << endl;
	cout << As[0];
	rep2(i, 1, N)
		cout << " " << As[i];
	cout << endl;
	cout << Bs[0];
	rep2(i, 1, N)
		cout << " " << Bs[i];

	return 0;
}
