#include <bits/stdc++.h>
using namespace std;
char s[1100];
int main() {
  int t;
  cin >> t;
  ++t;
  while (--t) {
    scanf("%s", s);
    int l;
    l = strlen(s);
    char ch;
    ch = s[l - 1];
    if (ch == 'o')
      printf("FILIPINO\n");
    else if (ch == 'u')
      printf("JAPANESE\n");
    else
      printf("KOREAN\n");
  }
  return 0;
}
