Task: Program Execution
Input (English): 2, 2, ['G', '7109', 'P', '8213']
Output (English): 7109