#pragma region shig_templates

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> pairI2;
typedef pair<LL, LL> pairLL2;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef vector<VI> VVI;
typedef vector<VVI> VVVI;
typedef vector<string> VS;
#define shig_for(i, a, b) for(int i = (a); i < (b); ++i)
#define shig_rep(i, n) shig_for(i, 0, n)
#define shig_forB(bit,a,b) for(int bit = (a); bit < (1<<(b)); ++bit)
#define shig_repB(bit,n) shig_forB(bit,0,n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define tmp int temp = 0
#define str string s

template<class T> void COUT(T&& t){ cout << t << endl; }
template<class T,class... Ts>
void COUT(T&& t,Ts&&... ts){ cout << t << " "; COUT(ts...); }
void CIN() {}
template<class T,class... Ts> void CIN(T&& t,Ts&&... ts){ cin >> t; CIN(ts...); }

#pragma endregion

int main(){

    LL N;
    CIN(N);
    vector<VLL> C(N, VLL(N, 0));

    shig_rep(i, N){
        shig_rep(j, N){
            CIN(C[i][j]);
        }
    }

    vector<VLL> check(N, VLL(N, 0));

    shig_rep(i, N){
        shig_rep(j, N){
            if(j == 0)continue;
            check[i][j] = C[i][j-1] - C[i][j];
        }
    }

    shig_rep(i, N){
        if(i == 0)continue;
        shig_rep(j, N){
            if(check[i][j] != check[i-1][j]){
                COUT("No");
                return 0;
            }
        }
    }

    LL mum = numeric_limits<int>::max();
    int itr = -1;
    shig_rep(i, N){
        if(C[i][0] < mum){
            mum = min(mum, C[i][0]);
            itr = i;
        }
    }

    COUT("Yes");
    shig_rep(i, N){
        cout << (C[i][0] - mum) << " ";
    }

    cout << endl;

    shig_rep(j, N){
        cout << C[itr][j] << " ";
    }

    cout << endl;


    //COUT(N);
    //for(string& s : S) cin >> s;
    //cout << fixed << setprecision(10) << ans << endl;

    return 0;
}
#include<bits/stdc++.h>
#define ll long long
using namespace std;

template <typename T, typename TT>
void print(T c, TT a,int n){
		
	vector<int> r;
	for(int i=0;i<n;i++)	
		r.push_back(a[i][0] - c[0]);

	
	int mi = *min_element(r.begin(), r.end());
	
	if(mi<0){
		for(auto &x:r)	x+=abs(mi);
		for(auto &x:c)	x-=abs(mi);
	}

	cout<<"Yes\n";
	for(auto x:r)	cout<<x<<" ";
	cout<<"\n";
	for(auto x:c)	cout<<x<<" ";
	cout<<"\n"; 
}

void solve(){
	int n;cin>>n;
	
	vector<vector<int>>a(n, vector<int>(n));
	for(int i=0;i<n;i++)
		for(int j=0;j<n;j++)
			cin>>a[i][j];


	for(int i=0;i<n;i++){
		vector<int> c = a[i];
		int fail = 0;

		for(int j=0;j<n && !fail;j++){
			if(j==i)	continue;

			vector<int>temp(n);
			for(int k=0;k<n;k++){
				temp[k] = a[j][k] - c[k];
			}
			sort(temp.begin(), temp.end());
			if(temp[0] != temp.back()){
				fail = 1;
				break;
			}
		}

		if(!fail){
			print(c, a, n);
			return;
		}
	}
	cout<<"No\n";
}

signed main(){
	ios_base::sync_with_stdio(false);cin.tie(NULL);
    #ifndef ONLINE_JUDGE    
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout); 
    #endif
   	solve();
    return 0;
}
