Task: Program Execution
Input (English): N, d, 2807, p, I, C, 3097, 5319, 8665, 8483, r, m, 2693, t, Y, Q, 4129, 8973, z, A, B, 589, 8329, 8713
Output (English): 2807, 3097, 5319, 8665, 8483, 2693, 4129, 8973, 589, 8329, 8713