Task: Program Execution
Input (English): 3, 3, ['5709', '2469', 'S', 'N']
Output (English): S