#include "testlib.h"
#include <string>
#include <vector>
#include <sstream>
#include <cmath>

using namespace std;

typedef vector<int> vi;

bool dfs(int x, int c, int k, int N, vi& color, const vector<vi>& a) {
	if (color[x])
		return c == color[x];
	color[x] = c;
	
	for (int i = 0; i < N; ++i) if (a[x][i] == k)
		if (!dfs(i, 3 - c, k, N, color, a))
			return false;
	
	return true;
}

int main(int argc, char * argv[])
{	
    setName("checker for problem 'avia2'");
    registerTestlibCmd(argc, argv);

	long long N = inf.readInt();
	
	int jAns = ans.readInt();
	int uAns = ouf.readInt();
	
	if (jAns < uAns)
		quitf(_wa, "too many airlines");
		
	vector< vi > a(N, vi(N, 0));
	for (int i = 0; i < N; ++i) {
		for (int j = 1; i + j < N; ++j) {
			a[i][j+i] = a[i+j][i] = ouf.readInt(1, uAns);
		}
	}
	
	for (int k = 1; k <= uAns; ++k) {
		vi color(N, 0);
		for (int i = 0; i < N; ++i) if (color[i] == 0) 
			if (!dfs(i, 1, k, N, color, a))
				quitf(_wa, "odd cycle of color %d", k);
	}
	
	if (uAns < jAns)
		quitf(_fail, "user has found better ans than author");
	
    quitf(_ok, "ok");
}
