Task: Program Execution
Input (English): 3, 7, ['J', '6195', 'R', 'D', '4997', 'A', 'a']
Output (English): 4997