#CCBCHBAHAI0000114. Thay tất cả x bằng y và đếm số lần thay

Thay tất cả x bằng y và đếm số lần thay

Replace Every x by y and Count Replacements

Source: Phước Hưng OJ

Version: Phuoc Hung OJ Extended

Problem

Given A=(a0,…,an−1)A=(a_0,\ldots,a_{n-1}) and integers x,yx,y, assign ai←ya_i\leftarrow y for every index whose original value equals xx. Also compute c=∣{i:aiold=x}∣c=|\{i:a_i^{old}=x\}|. If x=yx=y, the array is unchanged but each matching position still counts as an activated replacement.

Input

Read nn, then the array, then x,yx,y.

Output

Print cc, then the modified array.

Subtask

Subtask 1 (20 points): 1≤n≤101\le n\le10.

Subtask 2 (30 points): 1≤n≤10001\le n\le1000.

Subtask 3 (50 points): 1≤n≤1051\le n\le10^5, values within 10910^9 in magnitude.

Example

Input

6
2 5 2 7 2 9
2 8

Output

3
8 5 8 7 8 9

Explanation

Value 2 occurs three times, so three positions become 8.