Task: Program Execution
Input (English): N, 8143, 1279, 7011
Output (English): 16433