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