Task: Program Execution
Input (English): 2, ['161', 'S', '4951', 'n', 'A', '5123', '3249', '5009', 'Z', 'S']
Output (English): 161, 4951, A, 3249, Z