#include<bits/stdc++.h>
using namespace std;
int main(){
string s,mmax="a",temp;
cin>>s;
for(int i=0;i<s.length();i++)
{
temp="";
for(int j=i;j<s.length();j++)
{
temp+=s[j];
}
if(temp>mmax)mmax=temp;
}
cout<<mmax;
}