Problems
There is a table consisting of two horizontal rows and N columns.
In the first row, the integers 1, 2, …, N are placed in order, one in each column.
In the second row, each column contains an integer between 1 and N.
If you select some numbers from the first row, the set of the selected numbers and the set of the numbers directly beneath them in the second row must be identical.
Write a program to select integers from the first row so that this condition is satisfied, and the number of selected integers is maximized.
For example, when N = 7, suppose the table is given as follows.
In this case, selecting 1, 3, and 5 from the first row is the answer.
Beneath 1, 3, and 5 are 3, 1, and 5 respectively, and the two sets match.
The size of this set is 3.
If you select 1 and 3 from the first row, the integers beneath them are 3 and 1, so the sets also match.
However, the number of selected integers is not maximum, so it is not a valid answer.
Input
The first line contains an integer N (1 ≤ N ≤ 100).
The following N lines contain the integers in the second row, in order, one per line.
Output
Print the number of selected integers on the first line.
On the following lines, print the selected integers in increasing order, one integer per line.
Example
7
3
1
1
5
5
4
6
3
1
3
5