Task: Program Execution
Input (English): 3, 5, ['3479', 'X', '6251', '2961', 'a', 'h', '2723', '1665', '9009', 'Y', '7865', 'E', '2435', 'R', 'W', 'X', 'P', '8965', 'J', '1989']
Output (English): 6251, 1665, 2435, 8965