Task: Program Execution
Input (English): N, H, N, N, 5647, Q
Output (English): 5