let rec f?(s=Scanf.scanf"%s "(^)" ")x=s=" "&g(Sort.list(<)x@[s]);f(s::x)and g(s::t::x)=s=t&g x||g(print_string s;t::x);;f[]