Task: Program Execution
Input (English): 4, 4, ['Z', 'q', '7849', '4179', 'X', '3985', '7423', '3503', '9687', '9429', '7881', 'J', 'Z']
Output (English): 4179