Task: Program Execution
Input (English): 2, 5, ['R', '7501', '3899', '7595', '5921', 'S', '5809', 'b', '9667', 'n', 'S', '1371', '271']
Output (English): 7501, 5809, 1371