#include <stdio.h>
int main(void) {
char *s,word[100000],max_word[100000], cs[1];
gets(s);
for (int i=0;i<strlen(s);i++){
if (s[i]!=' ') {
cs[0]=s[i];
//printf("%s\n",cs);
strncat(word,cs,1);
//printf("%s\n",word);
} else {
if (strlen(max_word)<strlen(word)) strcpy(max_word,word);
strcpy(word,"");
}
if (strlen(max_word)<strlen(word)) strcpy(max_word,word);
}
printf("%s\n",max_word);
printf("%d\n",strlen(max_word));
return 0;
}