Task: Program Execution
Input (English): n, x, H, W, 5593, 723, 3967, 5927, 5527, 4043, 5201, q, 5893, 2619, b, d, U, Q, U
Output (English): 39493