Task: Program Execution
Input (English): 389, 317, 45, d, 321, 383, 371, 389
Output (English): 1, 2, 3, 4, 5, 7, 8, 9