#include <bits/stdc++.h>
using namespace std;
//全探索
int main() {
    int N;
    cin >> N;
    vector<vector<int>> C(N, vector<int> (N));
    for (int i = 0; i < N; i++) for (int j = 0; j < N; j++){
        cin >> C.at(i).at(j);
    }
    int min = C.at(0).at(0);
    for (int j = 0; j < N; j++){
        if(min > C.at(0).at(j)){
            min = C.at(0).at(j);
        }
    }
    vector<int> B(N);
    for (int j = 0; j < N; j++){
        B.at(j) = C.at(0).at(j) - min;
    }
    int minus = 0;
    vector<int> A(N);
    for (int i = 0; i < N; i++){
        A.at(i) = C.at(i).at(0) - B.at(0);
        if(A.at(i) < minus){
            minus = A.at(i);
        }
    }
    if(minus != 0){
        for (int k = 0; k < N; k++){
            A.at(k) += 0 - minus;
            B.at(k) += 0 - minus;
        }
    }
    //ここまででAとBが完成した。
    string res = "Yes";
    for (int i = 0; i < N; i++) for (int j = 0; j < N; j++){
        if(C.at(i).at(j) != A.at(i) + B.at(j)){
            res = "No";
            goto END;
        }
    }
END:
    cout << res << endl;
    if(res == "Yes"){
        for (int i = 0; i < N; i++){
            cout << A.at(i);
            if(i != N - 1){
                cout << " ";
            }else{
                cout << endl;
            }
        }
        for (int j = 0; j < N; j++){
            cout << B.at(j);
            if(j != N - 1){
                cout << " ";
            }else{
                cout << endl;
            }
        }
    }
}
#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
 
#define F first
#define S second
#define ALL(a) a.begin(),a.end()
#define mp make_pair
#define pb push_back
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define FORN(i,a,b) for(int i=a;i<=b;i++)
#define FORB(i,a,b) for(int i=a;i>=b;i--)
#define INT_MAXI 2147483647
#define INT_MINI -2147483648
#define REV(a) reverse(a.begin(),a.end())
#define NP(a) next_permutation(a.begin(),a.end())
 
typedef pair<int,int> pi;
typedef pair<ll,ll> pl; 
typedef vector<int> vi;
typedef vector<ll> vl;

int findMin(vi arr, int n)
{
    // Calculate sum of all elements
    int sum = 0;
    for (int i = 0; i < n; i++)
        sum += arr[i];
 
    // Create an array to store results of subproblems
    bool dp[n+1][sum+1];
 
    // Initialize first column as true. 0 sum is possible
    // with all elements.
    for (int i = 0; i <= n; i++)
        dp[i][0] = true;
 
    // Initialize top row, except dp[0][0], as false. With
    // 0 elements, no other sum except 0 is possible
    for (int i = 1; i <= sum; i++)
        dp[0][i] = false;
 
    // Fill the partition table in bottom up manner
    for (int i=1; i<=n; i++)
    {
        for (int j=1; j<=sum; j++)
        {
            // If i'th element is excluded
            dp[i][j] = dp[i-1][j];
 
            // If i'th element is included
            if (arr[i-1] <= j)
                dp[i][j] |= dp[i-1][j-arr[i-1]];
        }
    }
  
    // Initialize difference of two sums.
    int diff = INT_MAX;
    for (int j=sum/2; j>=0; j--)
    {
        if (dp[n][j] == true)
        {
            diff = sum-2*j;
            break;
        }
    }
    return diff;
}
 
int main(){
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int n; cin >> n;
    vi v(n); for(auto &i:v) cin >> i;
    int dif = findMin(v, n), sum = accumulate(ALL(v), 0);
    cout << (sum + dif)/2 << '\n';
    return 0;
}
