Task: Program Execution
Input (English): 4827, 3771, 31, K, N, 1125, 4341
Output (English): 14095