import java.util.*;
public class Main {

   static String ans = "";


    private static void triplet(String first, String rest){

        int first_digit = Integer.parseInt(first);
        int second_digit = Integer.parseInt(rest.substring(0,1));

        if(first_digit < second_digit){

            int d = first_digit+1;
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            return;

        }else if(first_digit == second_digit){

            if(rest.length() == 1){

                ans = ans.concat(Integer.toString(first_digit));
                ans = ans.concat(Integer.toString(first_digit));
                ans = ans.concat(Integer.toString(first_digit));
                return;

            }else{

                triplet(rest.substring(0,1), rest.substring(1));
                return;
            }

        }else if(first_digit > second_digit){

            int d = first_digit;
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            return;
        }

    }

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        String N = scan.next();

        triplet(N.substring(0,1), N.substring(1));

        System.out.println(ans);
    }
} import java.util.*; util.* java public class Main {

   static String ans = "";


    private static void triplet(String first, String rest){

        int first_digit = Integer.parseInt(first);
        int second_digit = Integer.parseInt(rest.substring(0,1));

        if(first_digit < second_digit){

            int d = first_digit+1;
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            return;

        }else if(first_digit == second_digit){

            if(rest.length() == 1){

                ans = ans.concat(Integer.toString(first_digit));
                ans = ans.concat(Integer.toString(first_digit));
                ans = ans.concat(Integer.toString(first_digit));
                return;

            }else{

                triplet(rest.substring(0,1), rest.substring(1));
                return;
            }

        }else if(first_digit > second_digit){

            int d = first_digit;
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            return;
        }

    }

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        String N = scan.next();

        triplet(N.substring(0,1), N.substring(1));

        System.out.println(ans);
    }
} Main static String ans = ""; ans "" private static void triplet(String first, String rest){

        int first_digit = Integer.parseInt(first);
        int second_digit = Integer.parseInt(rest.substring(0,1));

        if(first_digit < second_digit){

            int d = first_digit+1;
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            return;

        }else if(first_digit == second_digit){

            if(rest.length() == 1){

                ans = ans.concat(Integer.toString(first_digit));
                ans = ans.concat(Integer.toString(first_digit));
                ans = ans.concat(Integer.toString(first_digit));
                return;

            }else{

                triplet(rest.substring(0,1), rest.substring(1));
                return;
            }

        }else if(first_digit > second_digit){

            int d = first_digit;
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            return;
        }

    } triplet {

        int first_digit = Integer.parseInt(first);
        int second_digit = Integer.parseInt(rest.substring(0,1));

        if(first_digit < second_digit){

            int d = first_digit+1;
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            return;

        }else if(first_digit == second_digit){

            if(rest.length() == 1){

                ans = ans.concat(Integer.toString(first_digit));
                ans = ans.concat(Integer.toString(first_digit));
                ans = ans.concat(Integer.toString(first_digit));
                return;

            }else{

                triplet(rest.substring(0,1), rest.substring(1));
                return;
            }

        }else if(first_digit > second_digit){

            int d = first_digit;
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            return;
        }

    } int first_digit = Integer.parseInt(first); first_digit Integer.parseInt(first) Integer.parseInt Integer first int second_digit = Integer.parseInt(rest.substring(0,1)); second_digit Integer.parseInt(rest.substring(0,1)) Integer.parseInt Integer rest.substring(0,1) rest.substring rest 0 1 if(first_digit < second_digit){

            int d = first_digit+1;
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            return;

        }else if(first_digit == second_digit){

            if(rest.length() == 1){

                ans = ans.concat(Integer.toString(first_digit));
                ans = ans.concat(Integer.toString(first_digit));
                ans = ans.concat(Integer.toString(first_digit));
                return;

            }else{

                triplet(rest.substring(0,1), rest.substring(1));
                return;
            }

        }else if(first_digit > second_digit){

            int d = first_digit;
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            return;
        } first_digit < second_digit first_digit second_digit {

            int d = first_digit+1;
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            return;

        } int d = first_digit+1; d first_digit+1 first_digit 1 ans = ans.concat(Integer.toString(d)) ans ans.concat(Integer.toString(d)) ans.concat ans Integer.toString(d) Integer.toString Integer d ans = ans.concat(Integer.toString(d)) ans ans.concat(Integer.toString(d)) ans.concat ans Integer.toString(d) Integer.toString Integer d ans = ans.concat(Integer.toString(d)) ans ans.concat(Integer.toString(d)) ans.concat ans Integer.toString(d) Integer.toString Integer d return; if(first_digit == second_digit){

            if(rest.length() == 1){

                ans = ans.concat(Integer.toString(first_digit));
                ans = ans.concat(Integer.toString(first_digit));
                ans = ans.concat(Integer.toString(first_digit));
                return;

            }else{

                triplet(rest.substring(0,1), rest.substring(1));
                return;
            }

        }else if(first_digit > second_digit){

            int d = first_digit;
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            return;
        } first_digit == second_digit first_digit second_digit {

            if(rest.length() == 1){

                ans = ans.concat(Integer.toString(first_digit));
                ans = ans.concat(Integer.toString(first_digit));
                ans = ans.concat(Integer.toString(first_digit));
                return;

            }else{

                triplet(rest.substring(0,1), rest.substring(1));
                return;
            }

        } if(rest.length() == 1){

                ans = ans.concat(Integer.toString(first_digit));
                ans = ans.concat(Integer.toString(first_digit));
                ans = ans.concat(Integer.toString(first_digit));
                return;

            }else{

                triplet(rest.substring(0,1), rest.substring(1));
                return;
            } rest.length() == 1 rest.length() rest.length rest 1 {

                ans = ans.concat(Integer.toString(first_digit));
                ans = ans.concat(Integer.toString(first_digit));
                ans = ans.concat(Integer.toString(first_digit));
                return;

            } ans = ans.concat(Integer.toString(first_digit)) ans ans.concat(Integer.toString(first_digit)) ans.concat ans Integer.toString(first_digit) Integer.toString Integer first_digit ans = ans.concat(Integer.toString(first_digit)) ans ans.concat(Integer.toString(first_digit)) ans.concat ans Integer.toString(first_digit) Integer.toString Integer first_digit ans = ans.concat(Integer.toString(first_digit)) ans ans.concat(Integer.toString(first_digit)) ans.concat ans Integer.toString(first_digit) Integer.toString Integer first_digit return; {

                triplet(rest.substring(0,1), rest.substring(1));
                return;
            } triplet(rest.substring(0,1), rest.substring(1)) triplet rest.substring(0,1) rest.substring rest 0 1 rest.substring(1) rest.substring rest 1 return; if(first_digit > second_digit){

            int d = first_digit;
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            return;
        } first_digit > second_digit first_digit second_digit {

            int d = first_digit;
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            return;
        } int d = first_digit; d first_digit ans = ans.concat(Integer.toString(d)) ans ans.concat(Integer.toString(d)) ans.concat ans Integer.toString(d) Integer.toString Integer d ans = ans.concat(Integer.toString(d)) ans ans.concat(Integer.toString(d)) ans.concat ans Integer.toString(d) Integer.toString Integer d ans = ans.concat(Integer.toString(d)) ans ans.concat(Integer.toString(d)) ans.concat ans Integer.toString(d) Integer.toString Integer d return; String first first String rest rest public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        String N = scan.next();

        triplet(N.substring(0,1), N.substring(1));

        System.out.println(ans);
    } main {

        Scanner scan = new Scanner(System.in);
        String N = scan.next();

        triplet(N.substring(0,1), N.substring(1));

        System.out.println(ans);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String N = scan.next(); N scan.next() scan.next scan triplet(N.substring(0,1), N.substring(1)) triplet N.substring(0,1) N.substring N 0 1 N.substring(1) N.substring N 1 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

   static String ans = "";


    private static void triplet(String first, String rest){

        int first_digit = Integer.parseInt(first);
        int second_digit = Integer.parseInt(rest.substring(0,1));

        if(first_digit < second_digit){

            int d = first_digit+1;
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            return;

        }else if(first_digit == second_digit){

            if(rest.length() == 1){

                ans = ans.concat(Integer.toString(first_digit));
                ans = ans.concat(Integer.toString(first_digit));
                ans = ans.concat(Integer.toString(first_digit));
                return;

            }else{

                triplet(rest.substring(0,1), rest.substring(1));
                return;
            }

        }else if(first_digit > second_digit){

            int d = first_digit;
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            return;
        }

    }

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        String N = scan.next();

        triplet(N.substring(0,1), N.substring(1));

        System.out.println(ans);
    }
} public class Main {

   static String ans = "";


    private static void triplet(String first, String rest){

        int first_digit = Integer.parseInt(first);
        int second_digit = Integer.parseInt(rest.substring(0,1));

        if(first_digit < second_digit){

            int d = first_digit+1;
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            return;

        }else if(first_digit == second_digit){

            if(rest.length() == 1){

                ans = ans.concat(Integer.toString(first_digit));
                ans = ans.concat(Integer.toString(first_digit));
                ans = ans.concat(Integer.toString(first_digit));
                return;

            }else{

                triplet(rest.substring(0,1), rest.substring(1));
                return;
            }

        }else if(first_digit > second_digit){

            int d = first_digit;
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            return;
        }

    }

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        String N = scan.next();

        triplet(N.substring(0,1), N.substring(1));

        System.out.println(ans);
    }
} Main
import java.util.*;
public class Main {

   static String ans = "";


    private static void triplet(String first, String rest){

        int first_digit = Integer.parseInt(first);
        int second_digit = Integer.parseInt(rest.substring(0,1));

        if(first_digit < second_digit){

            int d = first_digit+1;
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            return;

        }else if(first_digit == second_digit){

            if(rest.length() == 1){

                ans = ans.concat(Integer.toString(first_digit));
                ans = ans.concat(Integer.toString(first_digit));
                ans = ans.concat(Integer.toString(first_digit));
                return;

            }else{

                triplet(rest.substring(0,1), rest.substring(1));
                return;
            }

        }else if(first_digit > second_digit){

            int d = first_digit;
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            ans = ans.concat(Integer.toString(d));
            return;
        }

    }

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        String N = scan.next();

        triplet(N.substring(0,1), N.substring(1));

        System.out.println(ans);
    }
}