#include <bits/stdc++.h>

using i32 = std::int32_t;
using u32 = std::uint32_t;
using i64 = std::int64_t;
using u64 = std::uint64_t;
using i128 = __int128_t;
using u128 = __uint128_t;
using isize = std::ptrdiff_t;
using usize = std::size_t;

class rep {
    struct Iter {
        usize itr;
        constexpr Iter(const usize pos) noexcept: itr(pos) { }
        constexpr void operator ++ () noexcept { ++itr; }
        constexpr bool operator != (const Iter& other) const noexcept { return itr != other.itr; }
        constexpr usize operator * () const noexcept { return itr; }
    };
    const Iter first, last;
public:
    explicit constexpr rep(const usize first, const usize last) noexcept: first(first), last(std::max(first, last)) { }
    constexpr Iter begin() const noexcept { return first; }
    constexpr Iter end() const noexcept { return last; }
};

template <class T>
using Vec = std::vector<T>;

void B_main() {
    usize N;
    std::cin >> N;
    Vec<Vec<i32>> C(N, Vec<i32>(N));
    for (auto &v: C) {
        for (auto &x: v) {
            std::cin >> x;
        }
    }
    Vec<i32> Adif(N), Bdif(N);
    for (auto i: rep(1, N)) {
        Adif[i] = C[i][0] - C[0][0];
        for (auto j: rep(1, N)) {
            if (C[i][j] - C[0][j] != Adif[i]) {
                std::cout << "No\n";
                return;
            }
        }
    }
    for (auto j: rep(1, N)) {
        Bdif[j] = C[0][j] - C[0][0];
        for (auto i: rep(1, N)) {
            if (C[i][j] - C[i][0] != Bdif[j]) {
                std::cout << "No\n";
                return;
            }
        }
    }
    const auto Amin = -*std::min_element(Adif.begin(), Adif.end());
    const auto Bmin = -*std::min_element(Bdif.begin(), Bdif.end());
    if (C[0][0] < Amin + Bmin) {
        std::cout << "No\n";
        return;
    }
    Vec<i32> A(N), B(N);
    A[0] = Amin;
    B[0] = C[0][0] - Amin;
    for (auto i: rep(1, N)) {
        A[i] = A[0] + Adif[i];
        B[i] = B[0] + Bdif[i];
    }
    std::cout << "Yes\n";
    for (auto i: rep(0, N)) {
        std::cout << A[i] << " \n"[i + 1 == N];
    }
    for (auto i: rep(0, N)) {
        std::cout << B[i] << " \n"[i + 1 == N];
    }
    return;
}

int main() {
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);
    B_main();
    return 0;
}

#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<bitset>
#include<cmath>
#include<ctime>
#include<queue>
#include<map>
#include<set>

#define int long long
#define lowbit(x) (x&(-x))
#define mp(x,y) make_pair(x,y)
#define lc (x<<1)
#define rc (x<<1|1)
#define fi first
#define se second
#define mid ((l+r)>>1)
#define fan(x) (((x-1)^1)+1)
#define max Max
#define min Min
#define abs Abs

using namespace std;

inline int read()
{
	int ans=0,f=1;
	char c=getchar();
	while(c>'9'||c<'0'){if(c=='-')f=-1;c=getchar();}
	while(c>='0'&&c<='9'){ans=(ans<<1)+(ans<<3)+c-'0';c=getchar();}
	return ans*f;
}

inline void write(int x)
{
	if(x<0) putchar('-'),x=-x;
	if(x/10) write(x/10);
	putchar((char)(x%10)+'0');
}

template<typename T>inline T Abs(T a){return a>0?a:-a;};
template<typename T,typename TT>inline T Min(T a,TT b){return a>b?b:a;}
template<typename T,typename TT> inline T Max(T a,TT b){return a>b?a:b;}

const int N=505;
int n,a[N],b[N],c[N][N],fl=1;

signed main()
{
	n=read();
	for(int i=1;i<=n;++i)
		for(int j=1;j<=n;++j)
			c[i][j]=read();
	for(int i=2;i<=n;++i)
		for(int j=2;j<=n;++j)
			if(c[i][j]-c[i][j-1]!=c[i-1][j]-c[i-1][j-1])
				fl=0;
	for(int j=2;j<=n;++j)
		for(int i=2;i<=n;++i)
			if(c[i][j]-c[i-1][j]!=c[i][j-1]-c[i-1][j-1])
				fl=0;
	if(!fl)
	{
		printf("No\n");
		return 0;
	}
	int mn=1e18;
	for(int j=1;j<=n;++j)
		mn=min(mn,c[1][j]);
	for(int j=1;j<=n;++j)
		b[j]=c[1][j]-mn;
	for(int i=1;i<=n;++i)
		a[i]=c[i][1]-b[1];
	for(int i=1;i<=n;++i)
	{
		if(a[i]<0) fl=0;
		if(b[i]<0) fl=0;
	}
	if(!fl)
	{
		printf("No\n");
		return 0;
	}
	printf("Yes\n");
	for(int i=1;i<=n;++i)
		printf("%lld ",a[i]);
	printf("\n");
	for(int i=1;i<=n;++i)
		printf("%lld ",b[i]);
	return 0;
}