Selecting Numbers

Time limit1sMemory limit128 MB

Problem

There is a table with 2 rows and N columns. The first row contains the integers from 1 to N in order. In the i-th cell of the second row, there is an integer A_i between 1 and N.

Choose some integers from the first row and let them form a set S. The values A_i directly below the chosen integers form another set T. The choice is valid when S and T are the same set.

Find a valid choice with maximum |S|, and output the chosen integers.

Input

The first line contains an integer N (1 <= N <= 100). The next N lines contain A_1, A_2, ..., A_N in order, one integer per line. Each A_i is between 1 and N.

Output

Print the number of chosen integers on the first line. Then print the chosen integers in increasing order, one per line.