Task: Program Execution
Input (English): 5, d, p, M
Output (English): [['5', 'd', 'p'], ['5', 'd', 'M'], ['5', 'p', 'M'], ['d', 'p', 'M']]