a, b = read_line.split.map(&.to_i) puts (a - b).abs == 1 ? "Q" : "P"