from __future__ import print_function
from sys import stdin

def printf(str, *args):
	print(str % args, end='')

domain = 20

def readfile(fn, adjacency):
	adjacencymx = [[0 for j in range(len(adjacency[0]))] for i in range(len(adjacency))]
	fp = open(fn, 'r')
	lines = fp.readlines()
	for line in lines:
		values = line.strip('\n').split()
		x = int(values[0])
		y = int(values[1])

		adjacencymx[x][y] = 1
		printf("%2c(%2d, %2d)\t" %(' ',x,y))
	fp.close()
	return adjacencymx

fn = "pp2-1.dat"
adjacencymx = [[0 for j in range(domain+1)] for i in range(domain+1)]

adjacencymx = readfile(fn, adjacencymx)

printf("\n*******************************\n\n")

reflexivity = 1

for i in range(1, domain+1):
	if adjacencymx[i][i] == 0:
		reflexivity = 0
		break

if reflexivity == 1:
	printf("%5cR is reflexive relation\n"%' ')
else:
	printf("%5cR is not reflexive relation\n"%' ');

symmetry = 1
test = 1

for i in range(1, domain+1):
	for j in range(1, domain+1):
		if adjacencymx[i][j] == 1 and adjacencymx[j][i] == 0:
			symmetry = 0
			test = 0
			break
	if test == 0:
		break

if symmetry ==1:
	printf("%5cR is symmetric relation\n"%' ')
else:
	printf("%5cR is not symmetric relation\n"%' ')

transitivity = 1
test = 1
for i in range(1, domain+1):
	for j in range(1, domain+1):
		if adjacencymx[i][j] == 1:
			for k in range(1,6):
				if adjacencymx[j][k] == 1 and adjacencymx[i][k] == 0:
					transitivity = 0
					test = 0
					break
			if test == 0:
				break
	if test == 0:
		break

if transitivity == 1:
	printf("%5cR is transitive relation\n"%' ')
else:
	printf("%5cR is not transitive relation\n"%' ')

stdin.readline()