Task: Program Execution
Input (English): 6589, 111, d, l, g, V, 6127, S, 1755, 1671, 5463, 6639, J, b, P, C
Output (English): 6589, 111, 6127, 1755, 1671, 5463, 6639