query print