Fael has two strings, ABC
and DEF
could be ABDECF
.
Constraints
Subtask 1 [10%]
Subtask 2 [90%]
No additional constraints.
Input Specification
The first line of input contains two space-separated strings,
Output Specification
Output every possible intertwined string on its own line. Order does not matter, but duplicates should not be printed.
Sample Input
Copy
AB CD
Sample Output
Copy
ABCD
ACBD
CABD
CADB
ACDB
CDAB
Comments
orz uselessleaf