Task: Program Execution
Input (English): 5, 5, ['R', 'x', '8965', 'G', '727']
Output (English): 727