Task: Program Execution
Input (English): N, 8489, H, n, A, 8071, L, l, 845, M, 5737, 5599, 1603, 5095, 311, k, Z, 3717, S, I, a
Output (English): 8489, 8071, 845, 5737, 5599, 1603, 5095, 311, 3717