Task: Program Execution
Input (English): 3151, 9807, K, O
Output (English): 12958