Task: Program Execution
Input (English): 371, 429, 37, p, k
Output (English): 1, 2, 3, 4, 7, 9