procedure main() total := table(0) while line := read() do { line ? while tab(upto(~' ')) do total[tab(many(~' '))] +:= 1 } words := sort(total, 3) while write(get(words), " ", get(words)) end