#CCBCHBAHAI0000077. Xóa mọi phần tử ngoài đoạn [L, R] (Remove Elements Outside [L, R])

Xóa mọi phần tử ngoài đoạn [L, R] (Remove Elements Outside [L, R])

Remove Elements Outside [L, R]

Source: Phước Hưng OJ

Version: Phuoc Hung OJ Extended

Problem

Given a0,a1,…,an−1a_0,a_1,\ldots,a_{n-1} and integers L≤RL\le R, keep exactly the elements satisfying

L≤ai≤R,L\le a_i\le R,

remove all others, and preserve the relative order of the kept elements. If J={j0<⋯<jm−1}J=\{j_0<\cdots<j_{m-1}\} is the set of kept indices, then bk=ajkb_k=a_{j_k}.

Input

The first line contains nn, LL, and RR. The second line contains nn integers aia_i.

Output

Print mm, then the filtered array on the second line; if m=0m=0, the second line is empty.

Subtask

Subtask 1 (20 points): 1≤n≤101\le n\le10, ∣ai∣,∣L∣,∣R∣≤103|a_i|,|L|,|R|\le10^3, L≤RL\le R.

Subtask 2 (30 points): 1≤n≤50001\le n\le5000, ∣ai∣,∣L∣,∣R∣≤106|a_i|,|L|,|R|\le10^6, L≤RL\le R.

Subtask 3 (50 points): 1≤n≤2⋅1051\le n\le2\cdot10^5, ∣ai∣,∣L∣,∣R∣≤109|a_i|,|L|,|R|\le10^9, L≤RL\le R.

Example

Input

7 -2 5
-7 -2 0 8 5 6 1

Output

4
-2 0 5 1

Explanation

The output follows directly from the mathematical definition above.