Generating frequents at the end