Task: Program Execution
Input (English): Q, h, 4987, g, s, r, 5441, a, 6341, 9627, 3971, p, N, a, w, B, 5817, 8865, 107, 7727
Output (English): 52883