Task: Program Execution
Input (English): n, 471, 185, 375, 353, r
Output (English): 1, 3, 4, 5, 7, 8