#include<stdio.h>
#include<iostream>
#include<algorithm> // sort(ALL())
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector> // a.size() = sizeof(a)/sizeof(a[0])
#include<queue> // push(), front(), pop() 先入れ先出し
#include<map> // 連想配列 map<string, int>
#include<iomanip>
#include<set>
#include<utility>
#include<climits>
using namespace std;
#define FOR(i, a, b) for(int i=(a); i<(b);  i++)
#define REP(i, n)    for(int i=0;   i<(n);  i++)
#define REPl(i, n)   for(unsigned long i=0;   i<(n);  i++)
#define REP1(i, n)   for(int i=1;   i<=(n); i++)
#define pb push_back
#define mp make_pair
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define EPS 1e-7
#define ALL(obj) (obj).begin(), (obj).end()
using ul    = unsigned long;
using ll    = long long;
using ld    = long double;
using vint  = vector<int>;
using vul		= vector<ul>;
using vll   = vector<ll>;
using pint  = pair<int, int>;
using pll   = pair<ll, ll>;
using vpint = vector<pint>;
using vpll  = vector<pll>;
const int INF = (int)1e9 + 1;
const int MOD = (int)1e9 + 7;
#define INT(argu) (int)(argu+EPS)

int main(void)
{
  cin.tie(0);
  ios::sync_with_stdio(false);

	int n;
	scan(n);
  vector<vint> s(n);
  REP(i, n){
		REP(j, n){
			int tmp;
			scan(tmp);
			(s[i]).pb(tmp);
		}
	}

	vector<vint> sub_r(n-1); // n-1 x n
	REP(i, n-1){
		REP(j, n){
			(sub_r[i]).pb(s[i][j] - s[i+1][j]);
		}
	}

	REP(i, n-1){
		REP(j, n-1){
			if(sub_r[i][j] != sub_r[i][j+1]){
			 cout << "No" << endl;
			 return 0;
			}
		}
	}

	vector<vint> sub_c(n); // n x n-1
	REP(i, n){
		REP(j, n-1){
			(sub_c[i]).pb(s[i][j] - s[i][j+1]);
		}
	}
	REP(i, n-1){
		REP(j, n-1){
			if(sub_c[i][j] != sub_c[i+1][j]){
				cout << "No" << endl;
 			 	return 0;
			}
		}
	}

	vint a(n);
	REP(i, n){
		a[i] = *min_element(ALL(s[i]));
	}

	vint b(n);
	REP(j, n){
		int tmpmin = s[0][j];
		REP(i, n){
			if(tmpmin > s[i][j]) tmpmin = s[i][j];
		}
		b[j] = tmpmin;
	}

	int amin = *min_element(ALL(a));

	prin("Yes");
	REP(i,n){ cout << a[i]-amin << " "; }
	kaigyo;
	REP(i,n){ cout << b[i] << " "; }


	return 0;


//	cerr << LLONG_MAX << endl;

//  cout << ans << endl;

  return 0;
}

#include <bits/stdc++.h>

using namespace std;

const int MAX_N = 500 + 5;

int N, c[MAX_N][MAX_N], a[MAX_N][MAX_N], b[MAX_N];

int main() {
    scanf("%d", &N);
    for (int i = 1; i <= N; i ++)
        for (int j = 1; j <= N; j ++) {
            scanf("%d", c[i] + j);
            a[i][j] = c[i][j] - c[i][j - 1];
        }
    for (int i = 2; i <= N; i ++) {
        int t = a[1][i];
        for (int j = 2; j <= N; j ++)
            if (a[j][i] != t) {
                printf("No\n");
                return 0;
            }
    }
    for (int i = 2; i <= N; i ++) b[i] = b[i - 1] + a[1][i];
    int val = *min_element(b + 1, b + N + 1);
    for (int i = 1; i <= N; i ++) b[i] -= val;
    for (int i = 1; i <= N; i ++)
        if (c[1][i] < b[i]) {
            printf("No\n");
            return 0;
        }
    printf("Yes\n");
    for (int i = 1; i <= N; i ++) printf("%d%c", c[i][1] - b[1], "\n "[i < N]);
    for (int i = 1; i <= N; i ++) printf("%d%c", b[i], "\n "[i < N]);
    return 0;
}