import java.util.HashSet;
import java.util.Iterator;
import java.util.Random;
import java.util.Set;
public class a {
/**
* @param args
*/
public String random(){
Random ra=new Random();
Set set=new HashSet();
for(int i=0;i<4;i++){
int sd=ra.nextInt(10);
if(!set.contains(sd)){
set.add(sd);
}else{
i--;
}
}
String s=null;
StringBuffer st=new StringBuffer("");
Iterator it=set.iterator();
while(it.hasNext())
{
String a=it.next().toString();
st.append(a);
}
s=new String(st);
return s;
}
public static void main(String[] args) {
// TODO Auto-generated method stub
a d=new a();
String m=d.random();
System.out.print(m);
}
}