//方法一:
import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
while(in.hasNextLine()){
String s=in.nextLine();
System.out.println(MaxNumSubstring(s));
}
}
private static String MaxNumSubstring(String s) {
HashMap<Integer,String> map=new HashMap<>();
Set<Integer> set=new HashSet<>();
char[] a=s.toCharArray();
int n=a.length;
for(int i=0;i<n-1;i++){
if((a[i]>='0'&&a[i]<='9')){
for(int j=i+1;j<n;j++) {
if (!(a[j] >= '0' && a[j] <= '9')) {
String s1 = s.substring(i, j);
map.put(j - i, s1);
break;
}
if(j==n-1&&a[i]>='0'&&a[i]<='9'){
String s1 = s.substring(i, j+1);
map.put(j - i, s1);
}
}
}
}
set=map.keySet();
int max=0;
for(Integer i :set){
if(max<i)
max=i;
}
return map.get(max);
}
}
//方法二:
//【解题思路】:
//用max表示经过的数字长度最大值,count表示数字计数器,当为字母时重置为0 end表示数字尾部,每次满
//足数字时,对max进行判断,当max小于于count时,更新max和end
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
while(scanner.hasNext()){
String str = scanner.nextLine();
int max = 0,count=0,end=0;
for(int i=0;i<str.length();i++){
if(str.charAt(i)>=‘0’ && str.charAt(i)<=‘9’){
count++;
if(max<count){
max= count;
end = i;
}
}else{
count = 0;
}
}
System.out.println(str.substring(end-max+1,end+1));
}
}
}