#include <bits/stdc++.h>
using namespace std;
 
#define int long long int
#define double long double
#define pb push_back
#define fi first
#define se second
#define vi vector<int>
#define pii pair<int,int>
#define vpii vector<pii>
#define pqi priority_queue<int>
#define test int tcase; cin>>tcase; for(int tc = 1; tc <= tcase; tc++)
#define inp(a,n,f) int a[n+f];for(int hh=f;hh<n+f;hh++)cin>>a[hh];
#define printdecimal(k) cout<<fixed<<setprecision(k);
#define mem(a,k) memset(a,k,sizeof(a))
#define ub upper_bound
#define lb lower_bound
#define mii map<int,int>
#define all(v) v.begin(),v.end()
#define mod (int)(1e9+7)
#define inf LLONG_MAX
int exp(int x,int y){int res=1;x=x%mod;while(y>0){if(y&1)res=(res*x)%mod;y=y>>1;x=(x*x)%mod;}return res;}
int modinv(int x){return exp(x,mod-2);}
int add(int a,int b){a%=mod,b%=mod;a=((a+b)%mod+mod)%mod;return a;}
int sub(int a,int b){a=((a-b)%mod+mod)%mod;return a;}
int mul(int a,int b){a%=mod,b%=mod;a=((a*b)%mod+mod)%mod;return a;}


signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);

	int n;
	string s;
	cin>>n>>s;
	stack<char> st;
	for(char x:s)
	{
		if(st.size()<2)	st.push(x);
		else
		{
			char a,b;
			b=st.top();
			st.pop();
			a=st.top();
			st.pop();
			if(x=='x'&&a=='f'&&b=='o') continue;
			else
			{
				st.push(a);
				st.push(b);
				st.push(x);
			}
		}
	}
	cout<<st.size();		
	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);
	}

	mi = *min_element(c.begin(), c.end());
	
	if(mi<0){
		cout<<"No\n";
		return;
	}

	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;
}
