detect more than 2 repetitions of words and print only once