Task: Program Execution
Input (English): Q, 8, m, 7, Q, r
Output (English): [['Q', '8', 'm', '7', 'Q'], ['Q', '8', 'm', '7', 'r'], ['Q', '8', 'm', 'Q', 'r'], ['Q', '8', '7', 'Q', 'r'], ['Q', 'm', '7', 'Q', 'r'], ['8', 'm', '7', 'Q', 'r']]