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