#include <bits/stdc++.h>
using namespace std;
using LL = long long;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    vector<vector<int>> c(n, vector<int>(n));
    for(auto& v : c) for(int& x : v) cin >> x;
    for(int i = 1; i < n; i += 1)
        for(int j = 1; j < n; j += 1){
            if(c[i][j] - c[i][j - 1] != c[0][j] - c[0][j - 1]){
                cout << "No";
                return 0;
            }
        }
    cout << "Yes\n";
    int j = 0;
    for(int i = 0; i < n; i += 1) if(c[i][0] < c[j][0]) j = i;
    for(int i = 0; i < n; i += 1) cout << c[i][0] - c[j][0] << " "; cout << "\n";
    for(int i = 0; i < n; i += 1) cout << c[j][i] << " ";
    return 0;
}
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define REP(i,j) for(int i=0;i<j;i++)
#define REPA(i,j) for(int i=1;i<=j;i++)
#define FORN(i,j,k) for(int i=j;i<k;i++)
#define vi vector<int>
#define vvi vector<vi >
#define pii pair<int,int>
#define vpii vector<pii >
#define all(a) a.begin(),a.end()
using namespace std;
const int INF=1<<30;
//const ll INF=1ll<<60;
const ll MOD=1e9+7;
inline void read(int &x){
//	short neg=1;
	x=0;
	char c=getchar();
	/*while(c<'0'||c>'9'){
		if(c=='-')neg=-1;
		c=getchar();
	}*/
	while(c>='0'&&c<='9'){
		x=(x<<3)+(x<<1)+(c^48),c=getchar();
	}
//	x*=neg;
}
ll quick_mod(ll A,ll B){//A^B
    ll ret=1;
    A%=MOD;
    while(B)
    {
        if(B&1)ret=ret*A%MOD;
        B>>=1;
        A=A*A%MOD;
    }
    return ret;
}
const ld eps=1e-7; 
const int MAXN=1e5+10;
ld N;
ld A[MAXN];

ld f(ld x){
	ld ret=x;
	x*=2;
	ld cnt=0;
	REP(i,N)cnt+=min(A[i],x);
	cnt/=N;
	ret-=cnt;
	return ret;
}
int main(void){
	cin>>N;
	REP(i,N)cin>>A[i];
	
	ld up=(ld)INF,low=0,m1,m2;  
    while(up-low>=eps){  
        m1=low+(up-low)/3;  
        m2=up-(up-low)/3;  
        if(f(m1)<=f(m2))up=m2;  
        else low=m1;  
    }  
    ld ans=0;
    REP(i,N)ans+=A[i];
	ans/=N; 
    cout<<fixed<<setprecision(9)<<ans+f((m1+m2)/2);  
	return 0;
}

