A. Suffix Three

time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

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 tt (1≤t≤301≤t≤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 11 and at most 10001000 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.

Example

input

Copy

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

Copy

FILIPINO
JAPANESE
JAPANESE
KOREAN
FILIPINO
FILIPINO
JAPANESE
JAPANESE

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.

解题说明:水题,判断字符串末尾字母即可区分。



#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<cmath>

using namespace std;

int main()
{
	int l, i;
	scanf("%d ", &l);
	for (i = 0; i<l; i++)
	{
		char str[10000];
		gets(str);
		int n = strlen(str);
		if (str[n - 2] == 'p')
		{
			printf("FILIPINO\n");
		}
		else if (str[n - 2] == 's')
		{
			printf("JAPANESE\n");
		}
		else if (str[n - 2] == 'd')
		{
			printf("KOREAN\n");
		}
	}
	return 0;
}
发布了1749 篇原创文章 · 获赞 382 · 访问量 276万+

猜你喜欢

转载自blog.csdn.net/jj12345jj198999/article/details/104196643