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