import java.util.Scanner;publicclassMain{publicstaticvoidmain(String[] args){
Scanner sc =newScanner(System.in);int num = sc.nextInt();if(num >=1&& num <=54){for(int i =1; i <10; i++){for(int j =0; j <10; j++){for(int k =0; k <10; k++){if(i *2+ j *2+ k == num){
System.out.println(""+ i + j + k + j + i);}}}}for(int i =1; i <10; i++){for(int j =0; j <10; j++){for(int k =0; k <10; k++){if(i *2+ j *2+ k *2== num){
System.out.println(""+ i + j + k + k + j + i);}}}}}
sc.close();}}