#K64957. Merge Strings Alternately

    ID: 32090 Type: Default 1000ms 256MiB

Merge Strings Alternately

Merge Strings Alternately

Given two strings S and T, merge them by taking characters alternately from each string. If one string is longer, append the remaining characters at the end. For example, if S = "ABC" and T = "123", the result is "A1B2C3".

This process can be mathematically described by the formula: ( result = S_0 T_0 S_1 T_1 \ldots ) with the remaining characters appended after the shorter string is exhausted.

inputFormat

The input starts with an integer (T) on the first line, representing the number of test cases. Each test case consists of two lines: the first line is the string (S) and the second line is the string (T). Strings may be empty.

outputFormat

For each test case, output the merged string on a new line.## sample

3
ABC
123
AB
1234
A
1
A1B2C3

A1B234 A1

</p>