Task: Program Execution
Input (English): 5785, r, 5619, l, l, 9037, 147, u, 9227, T, q, h, U
Output (English): 1, 3, 6, 7, 9