Guitar
Sleeping during the day is impossible!
A.S. Lopatin
Sonya always brings her guitar on hikes. One evening, she and her friends gathered around the campfire to sing songs. Everyone was quite tired, so they decided that each person would play at most one song that evening, allowing them to go to bed earlier.
After someone finishes playing a song, they pass the guitar to a person they had previously chosen, and then they go to sleep. If the chosen person is no longer at the campfire, the entire group goes to sleep.
Moreover, once both neighbors of a person have played, that person loses interest and also goes to sleep.
Your task is to determine the order in which people will play the guitar.
Input
The first line of the input contains an integer n - the number of people around the campfire (3 ≤ n ≤ 100000). The second line contains n numbers, indicating preferences: the i-th number is the number of the person to whom the i-th person wants to pass the guitar. People are listed in counterclockwise order.
Initially, Sonya, who is number 1, has the guitar. It is guaranteed that no one plans to pass the guitar to themselves.
Output
On the first line, output an integer - the number of songs that will be played that evening. On the next line, output the numbers of the people who will play the guitar, in the order they will play.