Task: Program Execution
Input (English): 1271, k, 2493, 1961, Z, n, M
Output (English): 5725