Problem hidden
This problem was hidden by Editorial Board member probably because it has incorrect language version or invalid test data, or description of the problem is not clear.

EITREORD - Postorder

Given the pre order traversal and in-order traversal of a binary treee. Build and print the post-order traveral of the given tree.

Input

The first line contains N as the number of vertices (N <= 80 000).

The second line contains N numbers, which are preorder browsing lists.

The third line contains N numbers as the inorder browse list.

Output

Print out the postorder traversal .

Example

Input:
6
6 0 4 2 3 5 1 4 0 5 3 2 1
0 4 2 3 5 1
4 0 3 5 2 1
Output: 4 5 3 1 2 0


Added by:Ha Minh Ngoc
Date:2016-01-04
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:CSHARP C++ 4.3.2 CPP CPP14 CPP14-CLANG FSHARP GO JAVA JS-MONKEY NODEJS PHP PYTHON PYPY PYPY3 PYTHON3 RUBY SQLITE SWIFT VB.NET
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.