#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t > 0) {
    string x;
    cin >> x;
    string test = x.substr(x.length() - 2);
    if (test == "po") {
      cout << "FILIPINO" << endl;
    } else if (test == "su") {
      cout << "JAPANESE" << endl;
    } else {
      cout << "KOREAN" << endl;
    }
    --t;
  }
  return 0;
}
