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