little script to easily be able to compute top rewritings