#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
// --------------------------------------------------------
template<class T> bool chmax(T& a, const T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T& a, const T b) { if (b < a) { a = b; return 1; } return 0; }
#define FOR(i,l,r) for (ll i = (l); i < (r); ++i)
#define RFOR(i,l,r) for (ll i = (r)-1; (l) <= i; --i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(c) (c).begin(), (c).end()
#define RALL(c) (c).rbegin(), (c).rend()
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define MIN(c) *min_element(ALL(c))
#define MAX(c) *max_element(ALL(c))
#define SUMLL(c) accumulate(ALL(c), 0LL)
#define COUNT(c,v) count(ALL(c),(v))
#define SZ(c) ((ll)(c).size())
#define BIT(b,i) (((b)>>(i)) & 1)
#define PCNT(b) __builtin_popcountll(b)
#define CIN(c) cin >> (c)
#define COUT(c) cout << (c) << '\n'
#define debug(x) cerr << "l." << __LINE__ << " : " << #x << " = " << (x) << '\n'
ll llceil(ll a, ll b) { return (a + b - 1) / b; }
ll bitlen(ll b) { if (b <= 0) { return 0; } return (64LL - __builtin_clzll(b)); }
string toupper(const string& S) { string T(S); REP(i,SZ(T)) T[i] = toupper(T[i]); return T; }
string tolower(const string& S) { string T(S); REP(i,SZ(T)) T[i] = tolower(T[i]); return T; }
using P = pair<ll,ll>;
using VP = vector<P>;
using VVP = vector<VP>;
using VS = vector<string>;
using VVS = vector<VS>;
using VLL = vector<ll>;
using VVLL = vector<VLL>;
using VVVLL = vector<VVLL>;
using VB = vector<bool>;
using VVB = vector<VB>;
using VVVB = vector<VVB>;
using VD = vector<double>;
using VVD = vector<VD>;
using VVVD = vector<VVD>;
using VLD = vector<ld>;
using VVLD = vector<VLD>;
using VVVLD = vector<VVLD>;
static const double EPS = 1e-10;
static const double PI  = acos(-1.0);
static const ll MOD = 1000000007;
// static const ll MOD = 998244353;
static const ll INF = (1LL << 62) - 1;  // 4611686018427387904 - 1
// --------------------------------------------------------
// #include <atcoder/all>
// using namespace atcoder;


int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(15);

    ll N; cin >> N;
    VVLL C(N,VLL(N)); REP(i,N) REP(j,N) cin >> C[i][j];

    VLL A(N),B(N);
    A[0] = 0;
    REP(i,N) B[i] = C[0][i];
    FOR(i,1,N) A[i] = C[i][0] - B[0];

    FOR(i,1,N) FOR(j,1,N) {
        if (A[i] + B[j] != C[i][j]) {
            COUT("No"); return 0;
        }
    }

    ll min_a = MIN(A);
    ll min_b = MIN(B);
    if (min_a + min_b < 0) {
        COUT("No"); return 0;
    } else if (min_a < 0) {
        REP(i,N) A[i] += (-min_a);
        REP(i,N) B[i] += min_a;
    } else if (min_b < 0) {
        REP(i,N) B[i] += (-min_b);
        REP(i,N) A[i] += min_b;
    }

    COUT("Yes");
    REP(i,N) {
        if (i) cout << " ";
        cout << A[i];
    }
    cout << endl;
    REP(i,N) {
        if (i) cout << " ";
        cout << B[i];
    }
    cout << endl;

    return 0;
}

#pragma GCC optimize ("Ofast")
#pragma GCC optimization ("unroll-loops, no-stack-protector")
#pragma GCC target ("avx")
#pragma GCC target ("avx2")
#pragma GCC target ("fma")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair <int, int>
#define pll pair <ll, ll>
#define pci pair <char, int>
#define pld pair <ld, ld>
#define ppld pair <pld, pld>
#define ppll pair <pll, pll>
#define pldl pair <ld, ll>
#define vll vector <ll>
#define vvll vector <vll>
#define vpll vector <pll>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define mll map <ll, ll>
#define fastmap gp_hash_table
#define cd complex <double>
#define vcd vector <cd>
#define PI 3.14159265358979
#define ordered_set tree <ll, null_type, less <ll>, rb_tree_tag, tree_order_statistics_node_update>
#pragma 03
using namespace std;
using namespace __gnu_pbds;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll a[505], b[505];
ll c[505][505];
int main(){
	fastio;
	ll n; cin >> n;
	for (ll i = 1; i <= n; i++){
		for (ll j = 1; j <= n; j++) cin >> c[i][j];
	}
	for (ll i = 1; i <= n; i++){
		a[i] = 1e9;
		for (ll j = 1; j <= n; j++) a[i] = min(a[i], c[i][j]);
	}
	for (ll j = 1; j <= n; j++) b[j] = c[1][j] - a[1];
	for (ll i = 2; i <= n; i++){
		for (ll j = 1; j <= n; j++){
			if (c[i][j] != a[i] + b[j]){
				cout << "No\n"; return 0;
			}
		}
	}
	cout << "Yes\n";
	for (ll i = 1; i <= n; i++) cout << a[i] << " ";
	cout << "\n";
	for (ll i = 1; i <= n; i++) cout << b[i] << " ";
	cout << "\n";
}