#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
#include <cmath>
#include <complex>
#include <functional>
#include <numeric>
#include <iomanip>
#include <cassert>
#include <random>
#include <chrono>

/* #include <atcoder/all> */
/* using namespace atcoder; */
using namespace std;

void debug_out(){ cout << "\n"; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << H << " ";
  debug_out(T...);
}
#ifdef _DEBUG
#define debug(...) debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

#define SPBR(w, n) std::cout<<(w + 1 == n ? '\n' : ' ');
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
#define ALL(i) (i).begin(), (i).end()
#define FOR(i, a, n) for(int i=(a);i<(n);++i)
#define RFOR(i, a, n) for(int i=(n)-1;i>=(a);--i)
#define REP(i, n) for(int i=0;i<int(n);++i)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define IN(a, x, b) (a<=x && x<b)
#define OUT(a, x, b) (x<a || b<=x)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

#define int ll
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const ll MOD = 1000000007;
/* const ll MOD = 998244353; */
const ll INF = 1ll<<60;
const double PI = acos(-1);

struct INIT { INIT(){
  cin.tie(0); ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
}}INIT;


signed main() {
  int N;
  cin >> N;

  vector<vector<int>> C(N, vector<int>(N));
  REP(i, N) REP(j, N) cin >> C[i][j];

  int MIN = C[0][0];
  REP(i, N){
    chmin(MIN, C[i][0]);
  }

  vector<int> A(N);
  REP(i, N){
    A[i] = C[i][0]-MIN;
  }

  vector<int> B(N);
  REP(i, N){
    B[i] = C[0][i]-A[0];
  }

  if(!all_of(ALL(B), [](int x){ return x >= 0; }) || !all_of(ALL(B), [](int x){ return x >= 0; })){
    No;
    return 0;
  }

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

  Yes;
  REP(i, A.size()){
    cout << A[i]; SPBR(i, A.size());
  }
  REP(i, B.size()){
    cout << B[i]; SPBR(i, B.size());
  }

  return 0;
}

#include<bits/stdc++.h>
typedef long long int ll;
using namespace std;
#define sz 509
#define mod 998244353
#define f first
#define s second
#define pa pair<ll,ll>
ll arr[sz][sz],brr[sz],crr[sz];
std::vector<pa> v;
int main()
{
 /// ios_base::sync_with_stdio(0);cin.tie(0);
 int test_case=1;
// scanf("%d",&test_case);
 while(test_case--)
 {
 ll n,m,a=0,b=0;
 scanf("%lld",&n);
 for(int i=1;i<=n;i++)
 {
  for(int j=1;j<=n;j++)
  {
    scanf("%lld",&arr[i][j]);
    if(j>1 && i>1 && (arr[i][j]+arr[i-1][j-1])!=(arr[i-1][j]+arr[i][j-1]))
      a++;
  }
 }
 if(a)
 {
  printf("No\n");
  return 0;
 }
 brr[1]=0;
 ll mn=0;
 for(int i=2;i<=n;i++)
 {
  brr[i]=brr[i-1]+arr[i][1]-arr[i-1][1];
  mn=min(mn,brr[i]);
 }
 for(int i=1;i<=n;i++)
 {
  brr[i]-=mn;
  crr[i]=arr[1][i]-brr[1];
 }
 for(int i=1;i<=n;i++)
 {
  for(int j=1;j<=n;j++)
  {
    if(brr[i]<0 ||  crr[j]<0 || (brr[i]+crr[j])!=arr[i][j])
    {
      printf("No\n");
      return 0;
    }
  }
 }
 printf("Yes\n");
 for(int i=1;i<=n;i++)
  printf("%lld ", brr[i]);
printf("\n");
for(int i=1;i<=n;i++)
  printf("%lld ",crr[i]);
printf("\n");
}
  return 0;
}