Task: Program Execution
Input (English): historical, d, q, in, N, Q
Output (English): historicaldqinNQ