while True:
try:
str = input()
except:
break
else:
list = []
for i in str:
list.append(int(ord(i)))
list.sort()
for i in list:
print(chr(i),end='')
print()
while True:
try:
str = input()
except:
break
else:
list = []
for i in str:
list.append(int(ord(i)))
list.sort()
for i in list:
print(chr(i),end='')
print()