Task: Program Execution
Input (English): Q, 6545, 6835, 1967, 3443, 1047, H, 1561, 6319, g, 1339, G, 8539, 1737, 4189, 1003, 3931, X, 1835, 9617, 1931, 8171
Output (English): 1, 7, 10, 12, 18