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



int main(){
	cin.tie(0)->sync_with_stdio(0);
	cin.exceptions(ios::badbit | ios::failbit);
	int n;
	cin >> n;
	vector<vector<int>> a(n, vector<int>(n));
	int ii = 0, jj = 0;
	for(auto i = 0; i < n; ++ i){
		for(auto j = 0; j < n; ++ j){
			cin >> a[i][j];
			if(a[ii][jj] > a[i][j]){
				ii = i, jj = j;
			}
		}
	}
	for(auto i = 1; i < n; ++ i){
		for(auto j = 1; j < n; ++ j){
			if(a[i - 1][j] - a[i - 1][j - 1] != a[i][j] - a[i][j - 1]){
				cout << "No\n";
				return 0;
			}
		}
	}
	cout << "Yes\n";
	for(auto i = 0; i < n; ++ i){
		cout << a[i][jj] << " ";
	}
	cout << "\n";
	for(auto j = 0; j < n; ++ j){
		cout << a[ii][j] - a[ii][jj] << " ";
	}
	cout << "\n";
	return 0;
}

/*

*/

////////////////////////////////////////////////////////////////////////////////////////
//                                                                                    //
//                                   Coded by Aeren                                   //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rrep(i, n) for (int i = 1; i < (int)(n+1); ++i)
const long long INF = 1LL<<60;
int main() {
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    int N;
    cin>>N;
    ll C[N][N];
    ll A[N];
    ll B[N];
    rep(i,N){
        A[i]=INF;
        B[i]=INF;
    }
    rep(i,N){
        rep(j,N){
        cin>>C[i][j];
            A[i]=min(A[i],C[i][j]);
            B[j]=min(B[j],C[i][j]);
        }
    }
    bool an=true;
    rep(i,N){
        rep(j,N){
            if(A[i]+B[j]<C[i][j]){
                an=false;
            }
        }
    }
    rep(i,N){
        rep(j,N){
            A[i]=min(A[i],C[i][j]-B[j]);
            B[j]=C[i][j]-A[i];
        }
    }
    rep(i,N){
        rep(j,N){
            if(A[i]+B[j]!=C[i][j]){
                an=false;
            }
        }
    }
    if(an==false){
        cout<<"No"<<endl;
    }
    else{
        cout<<"Yes"<<endl;
        rep(i,N){
            cout<<A[i];
            if(i!=N-1){
                cout<<" ";
            }
            else{
                cout<<""<<endl;
            }
        }
        rep(i,N){
            cout<<B[i];
            if(i!=N-1){
                cout<<" ";
            }
            else{
                cout<<""<<endl;
            }
        }
    }
}

