#include <bits/stdc++.h>
using namespace std;
long long n;
string s;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s;
    if (s[s.size() - 1] == 'o') cout << "FILIPINO" << endl;
    if (s[s.size() - 1] == 'u') cout << "JAPANESE" << endl;
    if (s[s.size() - 1] == 'a') cout << "KOREAN" << endl;
  }
}
