#CCBCHBAHAI0000041. Xóa lần xuất hiện cuối cùng của x (Delete the Last Occurrence of x)

Xóa lần xuất hiện cuối cùng của x (Delete the Last Occurrence of x)

Xóa lần xuất hiện cuối cùng của x (Delete the Last Occurrence of x)

Source: Phước Hưng OJ

Version: Phuoc Hung OJ Extended

Problem

Given an integer array a0,a1,…,an−1a_0,a_1,\ldots,a_{n-1} and an integer xx.

If there exists an index ii such that ai=xa_i=x, define

p=max⁡{i∣0≤i<n, ai=x}.p=\max\{i\mid 0\le i<n,\ a_i=x\}.

Delete only the element at index pp and preserve the relative order of all remaining elements.

If xx does not occur in the array, leave the array unchanged.

Print the logical size after the operation and the resulting array.

Input

The first line contains integers n,xn,x. The second line contains nn integers a0,a1,…,an−1a_0,a_1,\ldots,a_{n-1}.

Output

Print the size after the operation on the first line. If the size is positive, print the resulting array on the second line.

Subtask

Subtask 1 (100 points): 1≤n≤2⋅1051\le n\le2\cdot10^5; ∣x∣,∣ai∣≤109|x|,|a_i|\le10^9.

Example

Input

6 3
3 1 3 2 3 4

Output

5
3 1 3 2 4

Explanation

The last occurrence of 3 is at index 4. Only the element at that index is deleted.