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

public class Main {

  public static void main(String[] args) {
    new Main().run();
  }

  public void run() {
    
    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {

      String line = in.readLine();
      int fd = Character.getNumericValue(line.charAt(0));

      int up = 0;
      for (int i = line.length()-1; i > 0; i--) {
        int digit = Character.getNumericValue(line.charAt(i));
        if(digit + up > fd) {
          up = 1;
        }
        else {
          up = 0;
        }
      }

      int cd=Character.getNumericValue(line.charAt(1));
      if(fd < cd + up)
        fd++;

      StringBuffer buf = new StringBuffer();
      for(int i=0; i<line.length(); i++)
        buf.append(fd);


      System.out.println(buf);
    }
    catch(IOException e) {
      System.err.println(e);
    }
  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

  public static void main(String[] args) {
    new Main().run();
  }

  public void run() {
    
    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {

      String line = in.readLine();
      int fd = Character.getNumericValue(line.charAt(0));

      int up = 0;
      for (int i = line.length()-1; i > 0; i--) {
        int digit = Character.getNumericValue(line.charAt(i));
        if(digit + up > fd) {
          up = 1;
        }
        else {
          up = 0;
        }
      }

      int cd=Character.getNumericValue(line.charAt(1));
      if(fd < cd + up)
        fd++;

      StringBuffer buf = new StringBuffer();
      for(int i=0; i<line.length(); i++)
        buf.append(fd);


      System.out.println(buf);
    }
    catch(IOException e) {
      System.err.println(e);
    }
  }
} Main public static void main(String[] args) {
    new Main().run();
  } main {
    new Main().run();
  } new Main().run() new Main().run new Main() String[] args args public void run() {
    
    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {

      String line = in.readLine();
      int fd = Character.getNumericValue(line.charAt(0));

      int up = 0;
      for (int i = line.length()-1; i > 0; i--) {
        int digit = Character.getNumericValue(line.charAt(i));
        if(digit + up > fd) {
          up = 1;
        }
        else {
          up = 0;
        }
      }

      int cd=Character.getNumericValue(line.charAt(1));
      if(fd < cd + up)
        fd++;

      StringBuffer buf = new StringBuffer();
      for(int i=0; i<line.length(); i++)
        buf.append(fd);


      System.out.println(buf);
    }
    catch(IOException e) {
      System.err.println(e);
    }
  } run {
    
    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {

      String line = in.readLine();
      int fd = Character.getNumericValue(line.charAt(0));

      int up = 0;
      for (int i = line.length()-1; i > 0; i--) {
        int digit = Character.getNumericValue(line.charAt(i));
        if(digit + up > fd) {
          up = 1;
        }
        else {
          up = 0;
        }
      }

      int cd=Character.getNumericValue(line.charAt(1));
      if(fd < cd + up)
        fd++;

      StringBuffer buf = new StringBuffer();
      for(int i=0; i<line.length(); i++)
        buf.append(fd);


      System.out.println(buf);
    }
    catch(IOException e) {
      System.err.println(e);
    }
  } try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {

      String line = in.readLine();
      int fd = Character.getNumericValue(line.charAt(0));

      int up = 0;
      for (int i = line.length()-1; i > 0; i--) {
        int digit = Character.getNumericValue(line.charAt(i));
        if(digit + up > fd) {
          up = 1;
        }
        else {
          up = 0;
        }
      }

      int cd=Character.getNumericValue(line.charAt(1));
      if(fd < cd + up)
        fd++;

      StringBuffer buf = new StringBuffer();
      for(int i=0; i<line.length(); i++)
        buf.append(fd);


      System.out.println(buf);
    }
    catch(IOException e) {
      System.err.println(e);
    } catch(IOException e) {
      System.err.println(e);
    } IOException e {
      System.err.println(e);
    } System.err.println(e) System.err.println System.err System System.err e {

      String line = in.readLine();
      int fd = Character.getNumericValue(line.charAt(0));

      int up = 0;
      for (int i = line.length()-1; i > 0; i--) {
        int digit = Character.getNumericValue(line.charAt(i));
        if(digit + up > fd) {
          up = 1;
        }
        else {
          up = 0;
        }
      }

      int cd=Character.getNumericValue(line.charAt(1));
      if(fd < cd + up)
        fd++;

      StringBuffer buf = new StringBuffer();
      for(int i=0; i<line.length(); i++)
        buf.append(fd);


      System.out.println(buf);
    } BufferedReader in = new BufferedReader(new InputStreamReader(System.in)) BufferedReader in = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) String line = in.readLine(); line in.readLine() in.readLine in int fd = Character.getNumericValue(line.charAt(0)); fd Character.getNumericValue(line.charAt(0)) Character.getNumericValue Character line.charAt(0) line.charAt line 0 int up = 0; up 0 for (int i = line.length()-1; i > 0; i--) {
        int digit = Character.getNumericValue(line.charAt(i));
        if(digit + up > fd) {
          up = 1;
        }
        else {
          up = 0;
        }
      } int i = line.length()-1; int i = line.length()-1; i line.length()-1 line.length() line.length line 1 i > 0 i 0 i-- i-- i {
        int digit = Character.getNumericValue(line.charAt(i));
        if(digit + up > fd) {
          up = 1;
        }
        else {
          up = 0;
        }
      } {
        int digit = Character.getNumericValue(line.charAt(i));
        if(digit + up > fd) {
          up = 1;
        }
        else {
          up = 0;
        }
      } int digit = Character.getNumericValue(line.charAt(i)); digit Character.getNumericValue(line.charAt(i)) Character.getNumericValue Character line.charAt(i) line.charAt line i if(digit + up > fd) {
          up = 1;
        }
        else {
          up = 0;
        } digit + up > fd digit + up digit up fd {
          up = 1;
        } up = 1 up 1 {
          up = 0;
        } up = 0 up 0 int cd=Character.getNumericValue(line.charAt(1)); cd Character.getNumericValue(line.charAt(1)) Character.getNumericValue Character line.charAt(1) line.charAt line 1 if(fd < cd + up)
        fd++; fd < cd + up fd cd + up cd up fd++ fd StringBuffer buf = new StringBuffer(); buf new StringBuffer() for(int i=0; i<line.length(); i++)
        buf.append(fd); int i=0; int i=0; i 0 i<line.length() i line.length() line.length line i++ i++ i buf.append(fd); buf.append(fd) buf.append buf fd System.out.println(buf) System.out.println System.out System System.out buf public class Main {

  public static void main(String[] args) {
    new Main().run();
  }

  public void run() {
    
    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {

      String line = in.readLine();
      int fd = Character.getNumericValue(line.charAt(0));

      int up = 0;
      for (int i = line.length()-1; i > 0; i--) {
        int digit = Character.getNumericValue(line.charAt(i));
        if(digit + up > fd) {
          up = 1;
        }
        else {
          up = 0;
        }
      }

      int cd=Character.getNumericValue(line.charAt(1));
      if(fd < cd + up)
        fd++;

      StringBuffer buf = new StringBuffer();
      for(int i=0; i<line.length(); i++)
        buf.append(fd);


      System.out.println(buf);
    }
    catch(IOException e) {
      System.err.println(e);
    }
  }
} public class Main {

  public static void main(String[] args) {
    new Main().run();
  }

  public void run() {
    
    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {

      String line = in.readLine();
      int fd = Character.getNumericValue(line.charAt(0));

      int up = 0;
      for (int i = line.length()-1; i > 0; i--) {
        int digit = Character.getNumericValue(line.charAt(i));
        if(digit + up > fd) {
          up = 1;
        }
        else {
          up = 0;
        }
      }

      int cd=Character.getNumericValue(line.charAt(1));
      if(fd < cd + up)
        fd++;

      StringBuffer buf = new StringBuffer();
      for(int i=0; i<line.length(); i++)
        buf.append(fd);


      System.out.println(buf);
    }
    catch(IOException e) {
      System.err.println(e);
    }
  }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

  public static void main(String[] args) {
    new Main().run();
  }

  public void run() {
    
    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {

      String line = in.readLine();
      int fd = Character.getNumericValue(line.charAt(0));

      int up = 0;
      for (int i = line.length()-1; i > 0; i--) {
        int digit = Character.getNumericValue(line.charAt(i));
        if(digit + up > fd) {
          up = 1;
        }
        else {
          up = 0;
        }
      }

      int cd=Character.getNumericValue(line.charAt(1));
      if(fd < cd + up)
        fd++;

      StringBuffer buf = new StringBuffer();
      for(int i=0; i<line.length(); i++)
        buf.append(fd);


      System.out.println(buf);
    }
    catch(IOException e) {
      System.err.println(e);
    }
  }
}