import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String str = in.nextLine();
        solve(str);
    }
    public static void solve(String s) {
            char[] chs = s.toCharArray();
            int count = 0;
            int[] ins = new int[chs.length];
            int x = 0;
            int[] r = new int[chs.length];
            for(int i = 0; i < chs.length; i++) {
                if(Character.isDigit(chs[i]) && i != chs.length - 1) {
                    ins[count] = i;
                    count++;
                }else {
                    int dex = 0;
                count = 0;
                for (int j = 0; j < ins.length; j++) {
                    if (ins[j] != 0) {
                        dex++;
                    }
                }
                if (dex > x) {
                    x = dex;
                    for (int j = 0; j < r.length; j++) {
                        r[j] = ins[j];
                        ins[j] = 0;
                    }
                }
            }
        }
        for(int i = r[0]; i < r.length; i++) {
            if(Character.isDigit(chs[i])) {
                System.out.print(chs[i]);
            }else{
                return;
            }
        }
    }
}