Task: Program Execution
Input (English): 3, ['B', 'Q', 'p', 'T', 'T', '3999']
Output (English): B, Q, p