#include <bits/stdc++.h>
#define FOR(i, a, n) for(ll i = (ll)a; i < (ll)n; i++)
#define FORR(i, n) for(ll i = (ll)n - 1LL; i >= 0LL; i--)
#define rep(i, n) FOR(i, 0, n)
#define ALL(x) begin(x), end(x)
using namespace std;
using ll = long long;
constexpr ll Mod = 998244353;
constexpr ll mod = 1e9 + 7;
constexpr ll inf = 1LL << 60;
const double PI = acos(-1);
template <typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) {
    return a < b && (a = b, true);
}
template <typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) {
    return a > b && (a = b, true);
}
/*-------------------------------------------*/

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int n;
    cin >> n;
    vector<vector<int>> c(n, vector<int>(n));

    vector<int> x;

    rep(i, n) {
        rep(j, n) cin >> c[i][j];
        if(x.empty()) {
            rep(j, n - 1) x.push_back(c[i][j + 1] - c[i][j]);
        } else {
            rep(j, n - 1) {
                if(c[i][j + 1] - c[i][j] != x[j]) {
                    cout << "No\n";
                    return 0;
                }
            }
        }
    }

    int mn = 1e9 + 1, ii, y;
    rep(i, n) rep(j, n) if(chmin(mn, c[i][j])) {
        ii = i;
        y = j;
    }

    vector<int> a(n), b(n);
    rep(i, n) a[i] = c[i][y] - mn;
    rep(j, n) b[j] = c[ii][j];

    cout << "Yes\n";
    rep(i, n) cout << a[i] << " \n"[i == n - 1];
    rep(i, n) cout << b[i] << " \n"[i == n - 1];

    return 0;
}
/* HAVE PATIENCE YOU CAN SOLVE EVERY QUESTION
   JUST THINK*/
   //#pragma GCC optimize("Ofast")
   //#pragma GCC optimize ("unroll-loops")
#include<bits/stdc++.h>
//#include <unordered_set>
//#include <unordered_map>

using namespace std;
int mod = 1000000007;
const double pi = 3.141592653689793238460;
const int inf = 0x3f3f3f3f;
const int   N = 2e5 + 5;
const int pr = 31;
#define ll long long 
#define vi vector<int> 
#define pb push_back
#define mp make_pair
#define MEM(x) memset(x,inf,sizeof(x))
#define fi first
#define se second
#define forn(i, n) for (int i = 0; i< n; i++)
#define forl(i,l,u) for(int i=(int)l;i<=(int)u;++i)
#define all(v) (v).begin(), (v).end()
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;


int gcd(int a, int b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
int f(int x, int y, string a[]) {
    int l;
    if (a[x][y] == '+')l = 1;
    else l = -1;
    return l;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);

    string s;
    cin >> s;
    int ans = 0;
    forn(i, 10000) {
        int x = i;
        vector<bool> v(10,false);
        forn(i, 4) {
            int m = x % 10;
            v[m] = true;
            x /= 10;
        }
        bool ok = true;
        forn(i, 10) {
            if (s[i] == 'o' && v[i] == false) ok = false;
            if (s[i] == 'x' && v[i] == true) ok = false;
        }
        if (ok)ans += 1ll;
    }
    cout << ans << endl;
}



