Task: Program Execution
Input (English): Q, 3029, h, 385, X, U, 6261, 4841, K, h
Output (English): 2, 4, 7, 8