Function used to sort all queries in order of their index value so that results of queries can be printed in same order as of input
bool compare1 ( Query x , Query y ) { return x . index < y . index ; }