Task: Program Execution
Input (English): 1343, q, 1951, 5191, R, Q, 1665, O
Output (English): 1343, 1951, 5191, 1665