import java.util.Scanner;

public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int ones = N % 10;
      int tens = (N / 10) % 10;
      int hundreds = (N / 100) % 10;
      
      if (tens > hundreds) {
        ++hundreds;
      } else if (tens == hundreds && ones > tens) {
        ++hundreds;
      }

      System.out.println(hundreds * 100 + hundreds * 10 + hundreds);
    }
  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int ones = N % 10;
      int tens = (N / 10) % 10;
      int hundreds = (N / 100) % 10;
      
      if (tens > hundreds) {
        ++hundreds;
      } else if (tens == hundreds && ones > tens) {
        ++hundreds;
      }

      System.out.println(hundreds * 100 + hundreds * 10 + hundreds);
    }
  }
} Main public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int ones = N % 10;
      int tens = (N / 10) % 10;
      int hundreds = (N / 100) % 10;
      
      if (tens > hundreds) {
        ++hundreds;
      } else if (tens == hundreds && ones > tens) {
        ++hundreds;
      }

      System.out.println(hundreds * 100 + hundreds * 10 + hundreds);
    }
  } main {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int ones = N % 10;
      int tens = (N / 10) % 10;
      int hundreds = (N / 100) % 10;
      
      if (tens > hundreds) {
        ++hundreds;
      } else if (tens == hundreds && ones > tens) {
        ++hundreds;
      }

      System.out.println(hundreds * 100 + hundreds * 10 + hundreds);
    }
  } Scanner in = new Scanner(System.in); in new Scanner(System.in) while (in.hasNext()) {
      int N = in.nextInt();
      int ones = N % 10;
      int tens = (N / 10) % 10;
      int hundreds = (N / 100) % 10;
      
      if (tens > hundreds) {
        ++hundreds;
      } else if (tens == hundreds && ones > tens) {
        ++hundreds;
      }

      System.out.println(hundreds * 100 + hundreds * 10 + hundreds);
    } in.hasNext() in.hasNext in {
      int N = in.nextInt();
      int ones = N % 10;
      int tens = (N / 10) % 10;
      int hundreds = (N / 100) % 10;
      
      if (tens > hundreds) {
        ++hundreds;
      } else if (tens == hundreds && ones > tens) {
        ++hundreds;
      }

      System.out.println(hundreds * 100 + hundreds * 10 + hundreds);
    } int N = in.nextInt(); N in.nextInt() in.nextInt in int ones = N % 10; ones N % 10 N 10 int tens = (N / 10) % 10; tens (N / 10) % 10 (N / 10) N 10 10 int hundreds = (N / 100) % 10; hundreds (N / 100) % 10 (N / 100) N 100 10 if (tens > hundreds) {
        ++hundreds;
      } else if (tens == hundreds && ones > tens) {
        ++hundreds;
      } tens > hundreds tens hundreds {
        ++hundreds;
      } ++hundreds hundreds if (tens == hundreds && ones > tens) {
        ++hundreds;
      } tens == hundreds && ones > tens tens == hundreds tens hundreds ones > tens ones tens {
        ++hundreds;
      } ++hundreds hundreds System.out.println(hundreds * 100 + hundreds * 10 + hundreds) System.out.println System.out System System.out hundreds * 100 + hundreds * 10 + hundreds hundreds * 100 + hundreds * 10 + hundreds hundreds * 100 hundreds 100 hundreds * 10 hundreds 10 hundreds String[] args args public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int ones = N % 10;
      int tens = (N / 10) % 10;
      int hundreds = (N / 100) % 10;
      
      if (tens > hundreds) {
        ++hundreds;
      } else if (tens == hundreds && ones > tens) {
        ++hundreds;
      }

      System.out.println(hundreds * 100 + hundreds * 10 + hundreds);
    }
  }
} public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int ones = N % 10;
      int tens = (N / 10) % 10;
      int hundreds = (N / 100) % 10;
      
      if (tens > hundreds) {
        ++hundreds;
      } else if (tens == hundreds && ones > tens) {
        ++hundreds;
      }

      System.out.println(hundreds * 100 + hundreds * 10 + hundreds);
    }
  }
} Main
import java.util.Scanner;

public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int ones = N % 10;
      int tens = (N / 10) % 10;
      int hundreds = (N / 100) % 10;
      
      if (tens > hundreds) {
        ++hundreds;
      } else if (tens == hundreds && ones > tens) {
        ++hundreds;
      }

      System.out.println(hundreds * 100 + hundreds * 10 + hundreds);
    }
  }
}