Олимпиадный тренинг

Задача 34822. Arithmetic of Sasha and Katya


Sasha and Katya are in elementary school. To study arithmetic, cards are used on which numbers are written (exactly one number is written on each card). One day they came to a math class, and Sasha, using all her cards, showed the number A, and Katya showed the number B. The teacher then wanted to give them a problem so that both Sasha and Katya could show the answer to it, each using only their own cards. At the same time, the teacher wants the desired number to be the maximum possible.

Input

Enter two non-negative integers A and B (each number on one line). The length of each of the numbers does not exceed 100 000 digits.

Imprint

Print a single number — The maximum integer that can be formed using both the digits of the first number and the digits of the second number. If none of these numbers can be formed, print -1.

Test examples

input

280138
798081
output
8810

input
123
456
output
-1