#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using ii = pair<int, int>;
using vi = vector<int>;
#define all(v) begin(v), end(v)
#define sz(v) (int)(v).size()
#define fi first
#define se second

const int N = 1e5 + 5;

int n, dp[N];

int main(int argc, char const *argv[])
{
#ifdef LOCAL
  freopen("in", "r", stdin);
#endif
  cin >> n;
  for(int i = n; i >= 1; --i) {
    dp[i] = 1;
    for(int j = i+i; j <= n; j += i) {
      dp[i] = max(dp[i], dp[j]+1);
    }
  }
  for(int i = 1; i <= n; ++i)
    cout << dp[i] << ' ';
  cout << endl;
  return 0;
}
/*
* use std::array instead of std::vector, if u can
* overflow?
* array bounds
*/
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
constexpr int inf=1e9+7;
constexpr ll longinf=1LL<<60 ;
constexpr ll mod=1e9+7 ;

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n;
    cin>>n;
    vector<vector<ll>> c(n,vector<ll>(n));
    rep(i,n){
        rep(j,n)cin>>c[i][j];
    }
    vector<ll> a(n), b(n);
    rep(i,n)a[i]=c[i][0];
    rep(i,n)b[i]=c[0][i];
    ll ami = inf,bmi=inf;
    rep(i,n)ami=min(a[i],ami);
    rep(i,n)bmi=min(b[i],bmi);
    if(ami+bmi<c[0][0]){
        cout<<"No"<<endl;
        return 0;
    }
    rep(i,n)a[i]-=ami;
    rep(i,n)b[i]-=(c[0][0]-ami);
    rep(i,n)rep(j,n){
        if(a[i]+b[j]!=c[i][j]){
            cout<<"No"<<endl;
            return 0;
        }
    }
    cout<<"Yes"<<endl;
    rep(i,n)cout<<a[i]<<" \n"[i+1==n];
    rep(i,n)cout<<b[i]<<" \n"[i+1==n];
    return 0;
}