/*
#include <stdio.h>
#include <stdlib.h>
int main()
{
double time[2][5];
double over=0;
int i, m;
for(i=0; i<5; i++)
{
scanf("%d %d", &time[0][i], &time[1][i]);
}
for(i=0; i<5; i++)
{
over=time[1][i]-time[0][i]
}
}
*/
/*
#include<stdio.h>
#include<string.h>
#define SIZE 50001
char stack[SIZE];
int top=-1;
void push(char a)
{
top++;
stack[top]=a;
}
char pop()
{
if(top==-1)
{
return -1;
}
return stack[top--];
}
int main()
{
char str[SIZE];
int i, err=0;
scanf("%s", str);
for(i=0; i<strlen(str); i++)
{
if(str[i]=='(')
{
push('(');
}
else if(str[i]==')')
{
int a = pop();
if(a==-1)
{
err++;
}
}
}
if(top==-1 && err==0)
{
printf("good");
}
else
{
printf("bad");
}
return 0;
}
#include<stdio.h>
#include<string.h>
#define SIZE 110
int st[SIZE]= {};
int top=-1;
void push(int data)
{
if(top==SIZE-1)
return ;
st[++top]=data;
}
int pop()
{
if(top==-1)
return 0;
return st[top--];
}
int main()
{
char str1[SIZE],str2[SIZE],t[SIZE];
int la,lb,lt,c=0,tm;
scanf("%s %s",str1,str2);
la=strlen(str1);
lb=strlen(str2);
if(la<lb)
{
strcpy(t,str1);
strcpy(str1,str2);
strcpy(str2,t);
lt=la;
la=lb;
lb=lt;
}
//긴 길이의 숫자가 str1에 있도록 함
//printf("%s\n%s",str1,str2);
while(lb>0)
{
tm=str1[--la]-'0'+str2[--lb]-'0'+c;
push(tm%10);
c=tm/10;
}
while(la>0)
{
tm=str1[--la]-'0'+c;
push(tm%10);
c=tm/10;
}
if(c!=0) push(c);
tm=top;
while(tm>=0)
{
printf("%d",pop());
tm--;
}
return 0;
}
*/
/*
#include<stdio.h>
#define SIZE 80001
int stack[SIZE];
int top=-1;
void push(int a)
{
top++;
stack[top]=a;
}
int pop()
{
if(top==-1) return -1;
return stack[top--];
}
int top_()
{
return stack[top];
}
int main()
{
int c[SIZE];
int n, i;
long long int h=0;
scanf("%d", &n);
for(i=0; i<n; i++)
{
scanf("%d", &c[i]);
}
push(c[0]);
for(i=1; i<n; i++)
{
if(c[i]>=top_())
{
if(top==-1)
{
push(c[i]);
}
else
{
pop();
i--;
continue;
}
}
else
{
h+=top+1;
push(c[i]);
}
}
printf("%lld", h);
return 0;
}
*/
#include<stdio.h>
#include<string.h>
#define SIZE 101
int main()
{
char n1[SIZE], n2[SIZE], t[SIZE];
int i, o, a, b;
scanf("%s %s", n1, n2);
if(strlen(n1)<strlen(n2))
{
a=strlen(n2);
b=strlen(n1);
strcpy(t, n1);
strcpy(n1, n2);
strcpy(n2, t);
}
else
{
if(n1>=n2)
{
a=strlen(n1);
b=strlen(n2);
}
else
{
a=strlen(n2);
b=strlen(n1);
strcpy(t, n1);
strcpy(n1, n2);
strcpy(n2, t);
}
}
printf("%s\n%s",n1,n2);
}