Task: Program Execution
Input (English): 3, 5, ['Q', '1713', '5631', 'S', 'X', 'R', '7133', '1869']
Output (English): XS1365