let f s=function|[]->[(0,s)]|(n,w)::t when w=s->(n+1,w)::t|t->(0,s)::t open List;;let l=sort compare(Str.split(Str.regexp" ")(read_line()));;map print_endline[snd(hd(sort(fun a b->fst b-fst a)(fold_right f l[])));hd(sort(fun a b->String.length b-String.length a)l)]