#BST0000013. Liệt kê khóa trong đoạn (Report BST Keys in a Range)

Liệt kê khóa trong đoạn (Report BST Keys in a Range)

Report BST Keys in a Range

Source: Phuoc Hung OJ

Version: Phuoc Hung OJ Extended

Problem Statement

Build a BST from a1,a2,…,ana_1,a_2,\ldots,a_n in insertion order. Duplicate keys are ignored.

Given integers LL and RR, if L≤RL\le R, select every stored key vv satisfying L≤v≤RL\le v\le R and print the selected keys in increasing order.

If L>RL>R, the requested range is considered empty and no key is selected.

Input

The first line contains nn.

If n>0n>0, the next line contains nn signed integers a1,a2,…,ana_1,a_2,\ldots,a_n. If n=0n=0, this line is absent.

The last line contains LL and RR.

Output

If at least one key belongs to the closed interval [L,R][L,R], print those keys in increasing order, separated by one space.

If no key qualifies or L>RL>R, print EMPTY.

Subtasks

Subtask 1 (20 points): 0≤n≤200\le n\le 20.

Subtask 2 (30 points): 0≤n≤50000\le n\le 5000.

Subtask 3 (50 points): 0≤n≤2000000\le n\le 200000.

In all subtasks, ai,L,Ra_i,L,R are signed 64-bit integers. Duplicate insertion keys are ignored.

Examples

Input

7
8 3 10 1 6 14 4
4 10

Output

4 6 8 10

Explanation

The stored keys in the closed interval [4,10][4,10] are 4,6,8,104,6,8,10. In increasing order they are exactly 4 6 8 10.