Process all queries one by one
for i in range ( Q ) : NEW_LINE INDENT inp = list ( input ( ) . split ( ) ) NEW_LINE i1 = int ( inp [ 0 ] ) NEW_LINE i2 = int ( inp [ 1 ] ) NEW_LINE ch = inp [ 2 ] NEW_LINE DEDENT