#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t = 1;
  cin >> t;
  while (t--) {
    long long a, b, c, d, e, f, i, j, k, m, n, o, x, y;
    string s;
    cin >> s;
    if (s[s.size() - 1] == 'o')
      cout << "FILIPINO\n";
    else if (s[s.size() - 1] == 'u')
      cout << "JAPANESE\n";
    else
      cout << "KOREAN\n";
  }
}
