Task: Program Execution
Input (English): g, 297, 261, 173, f, m, 461
Output (English): 1, 2, 3, 4, 6, 7, 9