Task: Program Execution
Input (English): 5, 10, ['8939', 'S', 'P', '2381', '3781', 'B', '8413', 'm', 'B', '1565', '681']
Output (English): 3781B8413mB1565