Task: Program Execution
Input (English): 3, 6, ['p', 'g', '6321', '4727', '2151', '7741', '4665', 'e', '2449', '6937', 'S']
Output (English): 1477151272741236