Task: Program Execution
Input (English): 2, 2, ['P', '1275', '4841', 'J']
Output (English): 1275