Task: Program Execution
Input (English): 1707, 381, 3957, 7853, 4987
Output (English): -1