#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  cin >> a;
  string s;
  for (int i = 0; i < a; i++) {
    cin >> s;
    if (s.back() == 'o') {
      cout << "FILIPINO"
           << "\n";
    } else if (s.back() == 'u') {
      cout << "JAPANESE"
           << "\n";
    } else {
      cout << "KOREAN"
           << "\n";
    }
  }
}
