import List import Random main=newStdGen>>=putStr.f.(`mod`720).fst.next f n=foldl(\a(x,y)->a++x++" buys for "++y++"\n")[]$zip(l n)$r$l n l=(permutations["Andy","Barb","Carl","Didi","Earl","Fran"]!!) r(h:t)=t++[h]