import java.util.Scanner;

public class Main{

	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);

		String st=sc.next();
		char nn[]=st.toCharArray();
		int n[]=new int[3];
		for(int i=0;i<3;++i){
			n[i]=Character.getNumericValue(nn[i]);
		}

		if(n[1]<=n[0] && n[2]<=n[0]){
			System.out.print(n[0]);
			System.out.print(n[0]);
			System.out.println(n[0]);
		}
		else {
			System.out.print(n[0]+1);
			System.out.print(n[0]+1);
			System.out.println(n[0]+1);
		}



	}
} import java.util.Scanner; Scanner java.util public class Main{

	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);

		String st=sc.next();
		char nn[]=st.toCharArray();
		int n[]=new int[3];
		for(int i=0;i<3;++i){
			n[i]=Character.getNumericValue(nn[i]);
		}

		if(n[1]<=n[0] && n[2]<=n[0]){
			System.out.print(n[0]);
			System.out.print(n[0]);
			System.out.println(n[0]);
		}
		else {
			System.out.print(n[0]+1);
			System.out.print(n[0]+1);
			System.out.println(n[0]+1);
		}



	}
} Main public static void main(String args[]){

		Scanner sc = new Scanner(System.in);

		String st=sc.next();
		char nn[]=st.toCharArray();
		int n[]=new int[3];
		for(int i=0;i<3;++i){
			n[i]=Character.getNumericValue(nn[i]);
		}

		if(n[1]<=n[0] && n[2]<=n[0]){
			System.out.print(n[0]);
			System.out.print(n[0]);
			System.out.println(n[0]);
		}
		else {
			System.out.print(n[0]+1);
			System.out.print(n[0]+1);
			System.out.println(n[0]+1);
		}



	} main {

		Scanner sc = new Scanner(System.in);

		String st=sc.next();
		char nn[]=st.toCharArray();
		int n[]=new int[3];
		for(int i=0;i<3;++i){
			n[i]=Character.getNumericValue(nn[i]);
		}

		if(n[1]<=n[0] && n[2]<=n[0]){
			System.out.print(n[0]);
			System.out.print(n[0]);
			System.out.println(n[0]);
		}
		else {
			System.out.print(n[0]+1);
			System.out.print(n[0]+1);
			System.out.println(n[0]+1);
		}



	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String st=sc.next(); st sc.next() sc.next sc char nn[]=st.toCharArray(); nn st.toCharArray() st.toCharArray st int n[]=new int[3]; n new int[3] 3 for(int i=0;i<3;++i){
			n[i]=Character.getNumericValue(nn[i]);
		} int i=0; int i=0; i 0 i<3 i 3 ++i ++i i {
			n[i]=Character.getNumericValue(nn[i]);
		} {
			n[i]=Character.getNumericValue(nn[i]);
		} n[i]=Character.getNumericValue(nn[i]) n[i] n i Character.getNumericValue(nn[i]) Character.getNumericValue Character nn[i] nn i if(n[1]<=n[0] && n[2]<=n[0]){
			System.out.print(n[0]);
			System.out.print(n[0]);
			System.out.println(n[0]);
		}
		else {
			System.out.print(n[0]+1);
			System.out.print(n[0]+1);
			System.out.println(n[0]+1);
		} n[1]<=n[0] && n[2]<=n[0] n[1]<=n[0] n[1] n 1 n[0] n 0 n[2]<=n[0] n[2] n 2 n[0] n 0 {
			System.out.print(n[0]);
			System.out.print(n[0]);
			System.out.println(n[0]);
		} System.out.print(n[0]) System.out.print System.out System System.out n[0] n 0 System.out.print(n[0]) System.out.print System.out System System.out n[0] n 0 System.out.println(n[0]) System.out.println System.out System System.out n[0] n 0 {
			System.out.print(n[0]+1);
			System.out.print(n[0]+1);
			System.out.println(n[0]+1);
		} System.out.print(n[0]+1) System.out.print System.out System System.out n[0]+1 n[0] n 0 1 System.out.print(n[0]+1) System.out.print System.out System System.out n[0]+1 n[0] n 0 1 System.out.println(n[0]+1) System.out.println System.out System System.out n[0]+1 n[0] n 0 1 String args[] args public class Main{

	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);

		String st=sc.next();
		char nn[]=st.toCharArray();
		int n[]=new int[3];
		for(int i=0;i<3;++i){
			n[i]=Character.getNumericValue(nn[i]);
		}

		if(n[1]<=n[0] && n[2]<=n[0]){
			System.out.print(n[0]);
			System.out.print(n[0]);
			System.out.println(n[0]);
		}
		else {
			System.out.print(n[0]+1);
			System.out.print(n[0]+1);
			System.out.println(n[0]+1);
		}



	}
} public class Main{

	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);

		String st=sc.next();
		char nn[]=st.toCharArray();
		int n[]=new int[3];
		for(int i=0;i<3;++i){
			n[i]=Character.getNumericValue(nn[i]);
		}

		if(n[1]<=n[0] && n[2]<=n[0]){
			System.out.print(n[0]);
			System.out.print(n[0]);
			System.out.println(n[0]);
		}
		else {
			System.out.print(n[0]+1);
			System.out.print(n[0]+1);
			System.out.println(n[0]+1);
		}



	}
} Main
import java.util.Scanner;

public class Main{

	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);

		String st=sc.next();
		char nn[]=st.toCharArray();
		int n[]=new int[3];
		for(int i=0;i<3;++i){
			n[i]=Character.getNumericValue(nn[i]);
		}

		if(n[1]<=n[0] && n[2]<=n[0]){
			System.out.print(n[0]);
			System.out.print(n[0]);
			System.out.println(n[0]);
		}
		else {
			System.out.print(n[0]+1);
			System.out.print(n[0]+1);
			System.out.println(n[0]+1);
		}



	}
}
