#include<stdio.h>
int main(){
	int x,y;
	int kon=0;
	scanf("%d %d",&x,&y);
	int j=1;
	int z=1;
	int pom=0;
	int c[100],c1[100];
	
	int n=0;
	while(x!=0){
		c[n]=x%10;
		
		x=x/10;
		n++;
	}
	
	int m=0;
	
	while(y!=0){
		c1[m]=y%10;
		
		y=y/10;
		m++;
	}
	
	int max;
	
	if(m>n){
		max=m;
	}
	else max=n;
	int k=0;
	int p[max];
	
	
	for(int i=0;i<max;i++){
		if(m<n){
			p[max]=c[i];
		}
		else p[max]=c1[i];
		if(c[i]>c1[i]){
			p[i]=c[i];
		}
		else if(c[i]==c1[i]){
			p[i]=c[i]+c1[i]*10;
			k++;
		}
		else p[i]=c1[i];
	}
	
	for(int i=0;i<max;i++){
		printf("%d\n %d\n",p[i],p[max]);
	}
	
	for(int i=0;i<max;i++){
		kon+=p[i]*j;
		j=j*10;
	}
	
	printf("%d",kon);

	return 0;
}