    #include<bits/stdc++.h>
    #include<vector>
    #define ll long long
    #define ld long double
    #define F first
    #define S second
    #define MAXN   1000005
    #define Tsetso ios_base::sync_with_stdio(0) ; cin.tie(0) ;
    using namespace std;
    #define rep(i,n)  for(int i=0;i<n;++i)
     
     
     
    int main() {
        string s;
        cin>>s;
        int t=s.size();
        char a;
        bool b=true;
        for(int i=1;i<t;i++){
            a=s[0];
            if(a==s[i]){
                b=true;

            }else{
                b=false;
                break;
            }

        }
        if(b){
            cout<<"Won";

        }else{
            cout<<"Lost";
        }
        return 0;
       
     }
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
constexpr ll mod=1e9+7;

int main()
{
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  ll n;
  cin>>n;
  vector<vector<ll>> c(n, vector<ll>(n));
  vector<ll> a(n, 1LL<<60), b(n);
  for (int i = 0; i < n; ++i)
  {
    for (int j = 0; j < n; ++j)
    {
      cin>>c[i][j];
      a[i] = min(a[i], c[i][j]);
    }
    b[i] = c[i][i] - a[i];
  }
  for (int i = 0; i < n; ++i)
  {
    for (int j = 0; j < n; ++j)
    {
      if (c[i][j] != a[i]+b[j]) {
        cout << "No";
        return 0;
      }
    }
  }
  cout << "Yes\n";
  for (int i = 0; i < n; ++i)
  {
    cout << a[i] << " ";
  }
  cout << "\n";
  for (int i = 0; i < n; ++i)
  {
    cout << b[i] << " ";
  }
}