import std.stdio, std.string; int main() { string buf; int[string] count; while( (buf = readln()) != null ) { foreach(string word; buf.split()){ if( !(word in count) ) count[word] = 0; count[word]++; } } string[][int] words; foreach(string word; count.keys) { words[count[word]] ~= word; } foreach(int v; words.keys.sort){ writef("%10.d: ", v); foreach(string w; words[v].sort) { writef("%s ", w); } writef("\n"); } return 0; }