Introduction - If you have any usage issues, please Google them yourself
Binary tree reconstruction
Description
Given binary tree in preorder traversal sequences and sequences, reconstruction binary tree, and its post-order traversal.
Input
The first is an integer t (0 <t <10), that the number of test cases. The following t lines, each line of input a test case contains two character sequences s1 and s2, where s1 is a binary tree traversal sequence first, s2 is the preorder sequence. between s1 and s2 are separated by a space. Sequence contains only uppercase letters, and each letter will only appear once.
Output
For each test case, output a single line after the binary tree traversal sequence of characters obtained, with no spaces between characters.