Task: Program Execution
Input (English): 1497, U, B, 3183, 2963, 8773, 1917, 5069, 6871, Q, g, M, 4685
Output (English): U, B, Q, g, M, 1497, 3183, 2963, 8773, 1917, 5069, 6871, 4685