Task: Program Execution
Input (English): 3945, N, D, 6441, 2415, M
Output (English): 3945, 6441, 2415