Task: Program Execution
Input (English): D, Q, t, 1151, 7243, 1391, 2161
Output (English): 11946