print query and rr