Task: Program Execution
Input (English): q, 387, 389, 19, g, j, m, p, 347
Output (English): 1, 3, 4, 7, 8, 9