Task: Program Execution
Input (English): 1, 1, ['3531', '7847', 'R', '2955', '1707']
Output (English): 3531