'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
#print 'Hello World!'
l=[13,15,1,6,14,4,5,7,2,16,9,11,10,12,8,3]
s=raw_input()
if s=="ELEMENT":
	n,m=raw_input().split(" ")
	n,m=int(n),int(m)

	print m
elif s=="PERMUTATION":
	for i in l:
		print i,