Check if the current element is not in any set then make parent as current element of the queries
if ( parent [ queries [ i ] ] == - 1 ) : NEW_LINE INDENT parent [ queries [ i ] ] = queries [ i ] NEW_LINE DEDENT