#include <bits/stdc++.h>
using namespace std;
long long n;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  t = 1;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    n = s.length();
    reverse((s).begin(), (s).end());
    if (s[0] == 'o') {
      cout << "FILIPINO\n";
    } else if (s[0] == 'u') {
      cout << "JAPANESE\n";
    } else {
      cout << "KOREAN\n";
    }
  }
  return 0;
}
