Task: Program Execution
Input (English): 3, 4, ['B', 'q', '1473', '3651']
Output (English): 5124