Task: Program Execution
Input (English): 7789, 5033, X, j, n, M, p, 5259, 6877
Output (English): 7789, 5033, 24, 10, 14, 13, 16, 5259, 6877