Output the answer for each query
for i in range ( q ) : NEW_LINE INDENT if ( binary [ i ] == 0 ) : NEW_LINE INDENT print ( freq0 [ a [ i ] ] ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( freq1 [ a [ i ] ] ) NEW_LINE DEDENT DEDENT