print query