import java.io.*; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int t = Integer.parseInt(br.readLine()); PrintWriter pw = new PrintWriter(System.out); for (int z = 0; z < t; z++) { long n = Long.parseLong(br.readLine()); if (n == 1) { pw.println("P"); } else { pw.println("K"); } } pw.flush(); br.close(); } }