public class Q5{
public static void main(String [] args){
int test1 = -1000;
for (int i=0;i<=9 ;i++ ){
test1 +=1000;
int test2 = -100;
for (int x =0 ; x<=9;x++ ){
test2 +=100;
int test3 = -10;
for (int y =0; y<=9 ; y++ ){
test3 +=10;
int test4 = -1;
for (int z =0; z<=9 ; z++ ){
test4 +=1;
if ((test2+test3+test4)*3 == (test1+test2+test3+test4) & (test1+test2+test3+test4) != 0){
System.out.println(test1+test2+test3+test4);
}
}
}
}
}
}
}