#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int q;
  cin >> q;
  while (q--) {
    string s;
    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;
  }
}
