Task: Program Execution
Input (English): 3, 5, ['3515', '4581', '8863', '2037', '7899', 'N']
Output (English): 18799