#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <iostream>
#include <cassert>
#include <cmath>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <cstdlib>

using namespace std;

#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define li long long
#define pii pair<int, int>
#define vi vector<int>
#define li long long

#define forn(i, n) for (int i = 0; i < (int)n; i++)
#define fore(i, b, e) for (int i = (int)b; i <= (int)e; i++)

const int MAXN = 505;

int c[MAXN][MAXN];

int main() {
	int n;
	scanf("%d", &n);
	forn(i, n) {
		forn(j, n) {
			scanf("%d", &c[i][j]);
		}
	}
	if (n > 1) {
		fore(i, 1, n - 1) {
			int ai = c[i][0] - c[0][0];
			forn(j, n) {
				if (c[i][j] - c[0][j] != ai) {
					//printf("i = %d j = %d ai = %d %d\n", i, j, ai, c[i][j] - c[0][j]);
					printf("No");
					exit(0);
				}
			}
		}
	}
	int upper = c[0][0];
	forn(j, n) {
		upper = min(upper, c[0][j]);
	}
	int lower = 0;
	forn(i, n) {
		forn(j, n) {
			lower = max(lower, c[0][j] - c[i][j]);
		}
	}
	if (lower <= upper) {
		int a0 = lower;
		vi b(n);
		forn(i, n) {
			b[i] = c[0][i] - a0;
			assert(b[i] >= 0);
		}
		printf("Yes\n");
		forn(i, n) {
			int val = c[i][0] - b[0];
			assert(val >= 0);
			printf("%d ", val);
		}
		printf("\n");
		forn(i, n) {
			printf("%d ", b[i]);
		}
	} else {
		printf("No");
	}
}
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int n;
vector<ll> a, b;

bool solve()
{
    cin >> n;
    vector<vector<ll>> c(n, vector<ll>(n));
    a.resize(n), b.resize(n);

    ll sum = 0;
    for (int i = 0; i < n; i++)
        for (int j = 0; j < n; j++)
        {
            cin >> c[i][j];
            sum += c[i][j];
        }

    if (sum % n != 0)
        return false;

    int mnidx = 0;
    for (int i = 0; i < n; i++)
        if (c[mnidx][0] > c[i][0])
            mnidx = i;

    for (int i = 0; i < n; i++)
        for (int j = 0; j < n - 1; j++)
            if (c[i][j + 1] - c[i][j] != c[mnidx][j + 1] - c[mnidx][j])
                return false;

    for (int i = 0; i < n; i++)
        b[i] = c[mnidx][i];

    for (int i = 0; i < n; i++)
        a[i] = c[i][0] - c[mnidx][0];

    return true;
}

int main()
{
    if (solve() == false)
    {
        cout << "No" << endl;
    }
    else
    {
        cout << "Yes" << endl;
        for (int i = 0; i < n; i++)
            cout << a[i] << " ";
        cout << endl;
        for (int i = 0; i < n; i++)
            cout << b[i] << " ";
        cout << endl;
    }
}
