Task: Program Execution
Input (English): 2, 3, ['4001', '487', 'R']
Output (English): 487