#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <sstream>
#include <cstring>
#include <cctype>
#include <cmath>
#include <vector>
#include <set>
#include <bitset>
#include <map>
#include <stack>
#include <queue>
#include <ctime>
#include <cassert>
#define _for(i,a,b) for(int i=(a);i<(b);++i)
#define _rep(i,a,b) for(int i=(a);i<=(b);++i)
#define mem(a,b) memset(a,b,sizeof(a))
using namespace std;
typedef long long LL;
inline int read_int(){
	int t=0;bool sign=false;char c=getchar();
	while(!isdigit(c)){sign|=c=='-';c=getchar();}
	while(isdigit(c)){t=(t<<1)+(t<<3)+(c&15);c=getchar();}
	return sign?-t:t;
}
inline LL read_LL(){
	LL t=0;bool sign=false;char c=getchar();
	while(!isdigit(c)){sign|=c=='-';c=getchar();}
	while(isdigit(c)){t=(t<<1)+(t<<3)+(c&15);c=getchar();}
	return sign?-t:t;
}
inline char get_char(){
	char c=getchar();
	while(c==' '||c=='\n'||c=='\r')c=getchar();
	return c;
}
inline void write(LL x){
	char c[21],len=0;
	if(!x)return putchar('0'),void();
	if(x<0)x=-x,putchar('-');
	while(x)c[++len]=x%10,x/=10;
	while(len)putchar(c[len--]+48);
}
inline void space(LL x){write(x),putchar(' ');}
inline void enter(LL x){write(x),putchar('\n');}
const int MAXN=505;
LL a[MAXN],d[MAXN],b[MAXN],c[MAXN][MAXN];
bool solve(int n){
	_for(i,1,n){
		d[i]=c[i][0]-c[0][0];
		_for(j,1,n){
			if(c[i][j]-c[0][j]!=d[i])
			return false;
		}
	}
	LL minv=0;
	_for(i,0,n)
	minv=min(minv,d[i]);
	_for(i,0,n)a[i]=d[i]-minv;
	_for(i,0,n){
		b[i]=c[0][i]-a[0];
		if(b[i]<0)
		return false;
	}
	return true;
}
int main()
{
//	freopen("test.in","r",stdin);
//	freopen("test.out","w",stdout);
	int n=read_int();
	_for(i,0,n)_for(j,0,n)c[i][j]=read_int();
	if(solve(n)){
		puts("Yes");
		_for(i,0,n)space(a[i]);
		puts("");
		_for(i,0,n)space(b[i]);
	}
	else
	puts("No");
	return 0;
}
#include <bits/stdc++.h>
#define ld long double
#define endl "\n"
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define ms(v,x) memset(v,x,sizeof(v))
#define all(v) v.begin(),v.end()
#define ff first
#define ss second
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define per(i, a, b) for(int i = b-1; i>=a ; i--)
#define trav(a, x) for(auto& a : x)
#define allin(a , x) for(auto a : x)
#define Unique(v) sort(all(v));v.erase(unique(all(v)),v.end());
#define sz(v) ((int)v.size())
//#define int long long  
using namespace std;
typedef vector<int> vi;
#define y1 abacaba
//#define left oooooopss
#define db(x) cerr << #x <<" == "<<x << endl;
#define db2(x,y) cerr<<#x <<" == "<<x<<", "<<#y<<" == "<<y<<endl;
#define db3(x,y,z) cerr << #x<<" == "<<x<<", "<<#y<<" == "<<y<<", "<<#z<<" == "<<z<<endl;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
std::mt19937 rng((int) std::chrono::steady_clock::now().time_since_epoch().count());
inline ll mod(ll n, ll m ){ ll ret = n%m; if(ret < 0) ret += m; return ret; }
ll gcd(ll a, ll b){return (b == 0LL ? a : gcd(b, a%b));}
ll exp(ll b,ll e,ll m){
  b%=m;
  ll ans = 1;
  for (; e; b = b * b % m, e /= 2)
      if (e & 1) ans = ans * b % m;
  return ans;
}


const int N = 200100;
const int M =998244353;


ll A[N],B[N];
int32_t main(){
  fastio;
  int n,m,k;
  cin >> n >> m >> k;

  for(int i=1;i<=k;i++){
    A[i] = mod(exp(i,n,M) - exp(i-1,n,M),M);

    B[i] = mod(exp(i,m,M),M);
   // db3(exp(i,n,M),A[i],B[i]);
  }
  ll res=0;
  for(int i=1;i<=k;i++){
    ll val = A[i];
    if(m==1){
      val = val;
    }else if(n==1){
      val = mod(val * (exp(k-i+1,m,M) - exp(k-i,m,M)),M);
    }else val = mod(val * B[k-i+1],M);
    res = mod(res + val,M);
  }
  cout << res << endl;

  // math -> gcd it all
  // Did u check N=1? Did you switch N,M?
}