Task: Program Execution
Input (English): M, t, 1853, 9701, h, 2631, 5817, w
Output (English): 13, 20, 1853, 9701, 8, 2631, 5817, 23