Task: Program Execution
Input (English): 4, 5, ['3977', '8333', '2143', '1229', '4751', 'P', '1277', 'G']
Output (English): 15749221