Task: Program Execution
Input (English): 3709, 7365, 737, 2899, X, E, p, 5871, 8569, q
Output (English): 1, 2, 3, 4, 8, 9