import sys
import nltk
from nltk.tokenize import word_tokenize
from nltk.stem.wordnet import WordNetLemmatizer
from nltk.tag import pos_tag
from nltk.corpus import wordnet

while True:
	c = input('')
	task = c[:4];
	c = c[4:];

	if task == "{LM}":		
		tTag = pos_tag([c])[0][1]
		if tTag.startswith('J'):
			useTag = wordnet.ADJ
		elif tTag.startswith('V'):
			useTag = wordnet.VERB
		elif tTag.startswith('N'):
			useTag = wordnet.NOUN
		elif tTag.startswith('R'):
			useTag = wordnet.ADV
		else:
			useTag = wordnet.NOUN

		print(c)
		sys.stdout.flush()

	elif task == "{PT}":
		print(pos_tag([c])[0][1])
		sys.stdout.flush()
		sys.stdout.flush()
		sys.stdout.flush()
		sys.stdout.flush()
		sys.stdout.flush()
		sys.stdout.flush()