Task: Program Execution
Input (English): X, J, 505, H, 2547, q, Q, 8401, g, c, P, 3211, 4715, 1839, J
Output (English): 505, 2547, 8401, 3211, 4715, 1839