#include <stdio.h>
#include <math.h>
unsigned BrCifara(unsigned long long n){
	unsigned br=0;
	while(n>0){
		n/=10;
		br++;
	}
	return br;
}
main(){
	unsigned long long A,B,C,broj=0;
	unsigned n,nA,nB,nC,max,i,a[18],b[18],c[18];
	scanf("%llu%llu%llu",&A,&B,&C);
	nA=BrCifara(A);
	nB=BrCifara(B);
	nC=BrCifara(C);
	n=nA+nB+nC;
	for(i=nA-1;i>=0;i--){
		a[i]=A%10;
		A/=10;
	}
	for(i=nB-1;i>=0;i--){
		b[i]=B%10;
		B/=10;
	}
	for(i=nC-1;i>=0;i--){
		c[i]=C%10;
		C/=10;
	}
	i=0;
	while(a[i]==b[i]||a[i]==c[i]||b[i]==c[i]){
		max=a[i];
		if(b[i]>max) max=b[i];
		if(c[i]>max) max=c[i];
		if(max==a[i]){
			broj+=A*pow(10,n-1);
			n-=nA;
		}
		if(max==b[i]){
			 broj+=B*pow(10,n-1);
			 n-=nB;
		}
		if(max==c[i]){
		 	broj+=C*pow(10,n-1);
		 	n-=nC;
		}
		i++;
	}
	printf("%llu",broj);
}