fn main() { let mut ab = String::new(); std::io::stdin().read_line(&mut ab).ok(); let ab: Vec = ab.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let a = ab[0]; let b = ab[1]; let minval = a.min(b); let maxval = a.max(b); if (maxval - minval == 1) && minval % 2 == 1 { println!("Q"); } else if maxval == minval && maxval % 2 == 1 { println!("Q"); } else { println!("P"); } }