Task: Program Execution
Input (English): 4, 6, ['n', '21', 'Q', '1045', '3047', 'J']
Output (English): J, 3047, 1045