import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        char[] digits = input.readLine().toCharArray();
        if (digits[0] >= digits[1] && digits[0] >= digits[2]) {
            System.out.println(digits[0] + "" + digits[0] + "" + digits[0]);
        }else{
            digits[0]++;
            System.out.println(digits[0] + "" + digits[0] + "" + digits[0]);
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        char[] digits = input.readLine().toCharArray();
        if (digits[0] >= digits[1] && digits[0] >= digits[2]) {
            System.out.println(digits[0] + "" + digits[0] + "" + digits[0]);
        }else{
            digits[0]++;
            System.out.println(digits[0] + "" + digits[0] + "" + digits[0]);
        }
    }
} Main public static void main(String[] args) throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        char[] digits = input.readLine().toCharArray();
        if (digits[0] >= digits[1] && digits[0] >= digits[2]) {
            System.out.println(digits[0] + "" + digits[0] + "" + digits[0]);
        }else{
            digits[0]++;
            System.out.println(digits[0] + "" + digits[0] + "" + digits[0]);
        }
    } main {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        char[] digits = input.readLine().toCharArray();
        if (digits[0] >= digits[1] && digits[0] >= digits[2]) {
            System.out.println(digits[0] + "" + digits[0] + "" + digits[0]);
        }else{
            digits[0]++;
            System.out.println(digits[0] + "" + digits[0] + "" + digits[0]);
        }
    } BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); input new BufferedReader(new InputStreamReader(System.in)) char[] digits = input.readLine().toCharArray(); digits input.readLine().toCharArray() input.readLine().toCharArray input.readLine() input.readLine input if (digits[0] >= digits[1] && digits[0] >= digits[2]) {
            System.out.println(digits[0] + "" + digits[0] + "" + digits[0]);
        }else{
            digits[0]++;
            System.out.println(digits[0] + "" + digits[0] + "" + digits[0]);
        } digits[0] >= digits[1] && digits[0] >= digits[2] digits[0] >= digits[1] digits[0] digits 0 digits[1] digits 1 digits[0] >= digits[2] digits[0] digits 0 digits[2] digits 2 {
            System.out.println(digits[0] + "" + digits[0] + "" + digits[0]);
        } System.out.println(digits[0] + "" + digits[0] + "" + digits[0]) System.out.println System.out System System.out digits[0] + "" + digits[0] + "" + digits[0] "" digits[0] digits[0] + "" + digits[0] + "" + digits[0] digits[0] digits 0 "" digits[0] digits 0 "" digits[0] digits 0 {
            digits[0]++;
            System.out.println(digits[0] + "" + digits[0] + "" + digits[0]);
        } digits[0]++ digits[0] digits 0 System.out.println(digits[0] + "" + digits[0] + "" + digits[0]) System.out.println System.out System System.out digits[0] + "" + digits[0] + "" + digits[0] "" digits[0] digits[0] + "" + digits[0] + "" + digits[0] digits[0] digits 0 "" digits[0] digits 0 "" digits[0] digits 0 String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        char[] digits = input.readLine().toCharArray();
        if (digits[0] >= digits[1] && digits[0] >= digits[2]) {
            System.out.println(digits[0] + "" + digits[0] + "" + digits[0]);
        }else{
            digits[0]++;
            System.out.println(digits[0] + "" + digits[0] + "" + digits[0]);
        }
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        char[] digits = input.readLine().toCharArray();
        if (digits[0] >= digits[1] && digits[0] >= digits[2]) {
            System.out.println(digits[0] + "" + digits[0] + "" + digits[0]);
        }else{
            digits[0]++;
            System.out.println(digits[0] + "" + digits[0] + "" + digits[0]);
        }
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        char[] digits = input.readLine().toCharArray();
        if (digits[0] >= digits[1] && digits[0] >= digits[2]) {
            System.out.println(digits[0] + "" + digits[0] + "" + digits[0]);
        }else{
            digits[0]++;
            System.out.println(digits[0] + "" + digits[0] + "" + digits[0]);
        }
    }
}
