#include<bits/stdc++.h> using namespace std; string a,z,b; int x,max1=0,min1=200; int main() { //小写122 97 大写90 65 while(cin>>a) { x=a.size(); if(min1>x){b=a;min1=a.size();} if(max1<x){z=a;max1=a.size();} } cout<<z<<endl<<b; return 0; }