Task: Program Execution
Input (English): A, k, 4737, 2791, w, 4477, 4941
Output (English): 16946