#define rep(i, n) for (int i = 0; i < n; i++)
#define All(a) a.begin(), a.end()
#define us unordered_set
#define eb emplace_back
#define pb push_back
#define ll long long
#define vt vector
#define mod 1000000007

#include <bits/stdc++.h>

using namespace std;

int main() {
    int n;
    cin >> n;
    vt<vt<int>> c(n, vt<int>(n));
    rep(i, n) rep(j, n) cin >> c[i][j];
    string ans = "Yes";
    int min_c = mod, min_i = 0;
    rep(i, n) {
        if (c[i][0] < min_c) {
            min_i = i;
            min_c = c[i][0];
        }
    }
    for (int i = 1; i < n; i++) {
        int dif = c[i][0] - c[i - 1][0];
        for (int j = 1; j < n; j++)
            if (c[i][j] - c[i - 1][j] != dif) ans = "No";
    }
    cout << ans << endl;
    if (ans == "No") return 0;
    rep(i, n) cout << c[i][0] - min_c << ' ';
    cout << endl;
    rep(i, n) cout << c[min_i][i] << ' ';
    cout << endl;
    return 0;
}

#include <bits/stdc++.h>
//#include <chrono>
//#pragma GCC optimize("O3")
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
#define ALL(a) a.begin(), a.end()

using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;

ll N,M,H,W,Q,K,A,B;
string S;
using P = pair<ll, ll>;
const ll INF = (1LL<<60);

template<class T> bool chmin(T &a, const T b){
    if(a > b) {a = b; return true;}
    else return false;
}
template<class T> bool chmax(T &a, const T b){
    if(a < b) {a = b; return true;}
    else return false;
}
template<class T> void my_printv(std::vector<T> v,bool endline = true){
    if(!v.empty()){
        for(std::size_t i{}; i<v.size()-1; ++i) std::cout<<v[i]<<" ";
        std::cout<<v.back();
    }
    if(endline) std::cout<<std::endl;
}

void no(){
    cout<<"No"<<endl;
    exit(0);
}

void yes(vec &a, vec &b){
    cout<<"Yes"<<endl;
    my_printv(a);
    my_printv(b);
    exit(0);
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cin>>N;
    if(N == 1){
        cin>>A;
        vec a(1, A), b(1, 0);
        yes(a, b);
    }
    mat c(N, vec(N));
    rep(i, N) rep(j, N) cin>>c[i][j];
    vec a(N), b(N);
    rep(i, N) a[i] = c[i][0];
    b[0] = 0;
    reps(j, 1, N){
        b[j] = c[0][j] - c[0][0];
        rep(i, N) {
            if (b[j] != c[i][j] - c[i][0]) no();
        }
    }
    ll minus = *min_element(ALL(b));
    rep(j, N) b[j] -= minus;
    minus = *min_element(ALL(a));
    rep(i, N) a[i] -= minus;
    ll d = c[0][0] - (a[0] + b[0]);
    if(d < 0) no();
    else {
        rep(i, N) a[i] += d;
        yes(a, b);
    }
}