printing bag of words for queries