#include <math.h>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, l, n) for (int i = (l); i < (n); i++)
#define max(p, q) ((p) > (q) ? (p) : (q))
#define min(p, q) ((p) < (q) ? (p) : (q))
#define mod
using ll = long long;
using P = pair<int, int>;
template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T> >;
const ll INF = 1e18 + 1;
int main()
{
  int n;
  cin >> n;
  VV<ll> c(n, V<ll>(n));
  V<ll> a(n), b(n);
  rep(i, 0, n) rep(k, 0, n)
          cin >>
      c[i][k];
  a[0] = 0;
  b[0] = c[0][0];
  rep(i, 1, n)
  {
    a[i] = c[0][i] - c[0][i - 1] + a[i - 1];
    b[i] = c[i][0] - c[i - 1][0] + b[i - 1];
  }
  int j = 0;
  rep(i, 0, n) rep(k, 1, n)
  {
    if (a[k] - a[k - 1] != c[i][k] - c[i][k - 1])
      j++;
    if (b[k] - b[k - 1] != c[k][i] - c[k - 1][i])
      j++;
  }
  if (j != 0)
    cout << "No" << endl;
  else
  {
    cout << "Yes" << endl;
    ll ma = INF, mb = INF;
    rep(i, 0, n)
    {
      ma = min(ma, a[i]);
      mb = min(mb, b[i]);
    }
    if (ma < 0)
    {
      rep(i, 0, n)
      {
        a[i] += -ma;
        b[i] += ma;
      }
    }
    if (mb < 0)
      rep(i, 0, n)
      {
        b[i] += -mb;
        a[i] += mb;
      }
    rep(i, 0, n) cout << b[i] << " ";
    cout << endl;
    rep(i, 0, n) cout << a[i] << " ";
    cout << endl;
  }

  return 0;
}

#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<cstring>
#include<queue>
#include<stack>
#include<numeric>
using namespace std;
#define INF (1 << 30) - 1
#define LINF 1LL << 60
const int MOD = 1000000007;
using ll = long long;
using P = pair<int, int>;

int main(){
  int n;
  cin >> n;
  vector<vector<int>> c(n, vector<int>(n));
  vector<int> a(n), b(n);
  for(int i = 0; i < n; i++){
    for(int j = 0; j < n; j++){
      cin >> c[i][j];
    }
  }

  int m = INF;
  for(int i = 0; i < n; i++)m = min(m, c[i][0]);
  for(int i = 0; i < n; i++)a[i] = c[i][0] - m;
  for(int i = 0; i < n; i++)b[i] = c[0][i] - a[0];
  
  for(int i = 0; i < n; i++){
    for(int j = 0; j < n; j++){
      if(c[i][j] != a[i] + b[j]){
	cout << "No" << endl;
	return 0;
      }
    }
  }

  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;
  return 0;
}
