Task: Program Execution
Input (English): 3, 7, ['5949', '4245', '7081', 'n', 'R', '8437', 'r', 'P']
Output (English): 15518