You are given an array
consisting of non-negative integers.
You have to replace each in with an integer from to (different elements equal to can be replaced by different integers).
The value of the array you obtain is the number of integers from to such that the following condition holds: there exist a pair of adjacent elements equal to (i. e. there exists some such that ). If there are multiple such pairs for some integer , this integer is counted in the value only once.
Your task is to obtain the array with the maximum possible value.
The first line contains one integer () — the number of elements in the array.
The second line contains integers () — the elements of the array.
Print integers not less than and not greater than — the array with the maximum possible value you can obtain.
If there are multiple answers, print any of them.
4 1 1 0 2
1 1 2 2
5 0 0 0 0 0
3 1 1 3 3
5 1 2 3 4 5
1 2 3 4 5
6 1 0 0 0 0 1
1 2 3 3 1 1
3 3 0 2
3 2 2
5 1 0 2 0 1
1 2 2 1 1
7 1 0 2 3 1 0 2
1 2 2 3 1 1 2
ConversionConversion EmoticonEmoticon