Task: Program Execution
Input (English): 5, 5, ['2471', 'W', '5943', '2471', '2429', '4595', '1215', '5841', 'E', '4859']
Output (English): 2429