import List main=interact$f.sortBy((.h).compare.h).lines f x=do(a,b)<-zip x$iterate(`div`2)$g$x!!1;"TF"!!(0^mod b 2):' ':a++"\n" g x|x<"v"=415835840511|x<"w"=70424461311|0<1=35185952292863 h=(0+).read.(!!2).words