#include long M,m;char s[9],*t;main(i){for(;gets(s);M=M?m