Task: Program Execution
Input (English): 2, 14, ['Q', '3161', 'X', 'g', '3319', 'R', 'a', 'J', 'Y', '981', '2827', 'E', 'W', 'r', '8169']
Output (English): 10288