Task: Program Execution
Input (English): 3, 3, ['Y', '3583', '6087', 'J']
Output (English): 6087