Task: Program Execution
Input (English): 5831, 4713, 8441, z, r, P
Output (English): 18985