1338: 中、后序遍历求前序遍历

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:3 Solved:2

Description

给出一个二叉树的中序遍历和后序遍历,求出二叉树的前序遍历

Input

共两行,第一行为二叉树的中序遍历,第二行为后序遍历,字符串为大写字母,长度不超过26字符,每个字符表示一个节点

Output

只有一行,为树的前序遍历

Sample Input Copy

ACBDFEG
ABDCGEF

Sample Output Copy

FCADBEG

Source/Category