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