问题3235--Minimum Integer sequence

3235: Minimum Integer sequence

[命题人 : ]
时间限制 : 1.000 sec  内存限制 : 32 MB

题目描述

Now we have two integers A and B, after insert B into A, we can get a new integer C, and then the problem comes: how to get a smallest C? For example, let A = 345, B = 478. As there are there digits in A, so there are four places for B to insert into. We can get 478345, 347845, 344785, 345478.After comparing, we could know that the smallest C is 344785.

输入

There are multiple test cases. Each test case takes one line, Each line contents two integers A and B(there will be less than 100000 digits in A and B and there is no digit values 0 in A and B), the two integers are separated by a space, process to the end of file.

输出

For each test case, output the smallest integer C.

样例输入 Copy

345 478
12345 678
123 123

样例输出 Copy

344785
12345678
112323

来源/分类

muti