#include <bits/stdc++.h>
using namespace std;
void solution(string s) {
  int l = s.length();
  if (s[l - 1] == 'o') {
    cout << "FILIPINO\n";
  } else if (s[l - 1] == 'u') {
    cout << "JAPANESE\n";
  } else {
    cout << "KOREAN\n";
  }
}
int main() {
  int q;
  cin >> q;
  cin.ignore();
  for (int i = 0; i < q; i++) {
    string s;
    cin >> s;
    solution(s);
  }
}
