Codeforces Round 607 (Div. 2)
A
Suffix Three
Codeforces
800
原题
←B →
翻译中…

We just discovered a new data structure in our research group: a suffix three!

翻译中…

It's very useful for natural language processing. Given three languages and three suffixes, a suffix three can determine which language a sentence is written in.

翻译中…

It's super simple, 100% accurate, and doesn't involve advanced machine learning algorithms.

翻译中…

Let us tell you how it works.

翻译中…
  • If a sentence ends with "po" the language is Filipino.
  • If a sentence ends with "desu" or "masu" the language is Japanese.
  • If a sentence ends with "mnida" the language is Korean.
翻译中…

Given this, we need you to implement a suffix three that can differentiate Filipino, Japanese, and Korean.

翻译中…

Oh, did I say three suffixes? I meant four.

翻译中…

Input

翻译中…

The first line of input contains a single integer $t$ ($1 \leq t \leq 30$) denoting the number of test cases. The next lines contain descriptions of the test cases.

翻译中…

Each test case consists of a single line containing a single string denoting the sentence. Spaces are represented as underscores (the symbol "_") for ease of reading. The sentence has at least $1$ and at most $1000$ characters, and consists only of lowercase English letters and underscores. The sentence has no leading or trailing underscores and no two consecutive underscores. It is guaranteed that the sentence ends with one of the four suffixes mentioned above.

翻译中…

Output

翻译中…

For each test case, print a single line containing either "FILIPINO", "JAPANESE", or "KOREAN" (all in uppercase, without quotes), depending on the detected language.

翻译中…

Note

翻译中…

The first sentence ends with "po", so it is written in Filipino.

翻译中…

The second and third sentences end with "desu" and "masu", so they are written in Japanese.

翻译中…

The fourth sentence ends with "mnida", so it is written in Korean.

翻译中…

样例

Input #1
8
kamusta_po
genki_desu
ohayou_gozaimasu
annyeong_hashimnida
hajime_no_ippo
bensamu_no_sentou_houhou_ga_okama_kenpo
ang_halaman_doon_ay_sarisari_singkamasu
si_roy_mustang_ay_namamasu
Output #1
FILIPINO
JAPANESE
JAPANESE
KOREAN
FILIPINO
FILIPINO
JAPANESE
JAPANESE
InputCopy OutputCopy
题目信息
题号
1281A
时间限制
1 s
内存限制
256 MB
标签
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。