B. Bye Bye Bilbo
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

Bilbo Baggins is finally leaving the Shire! To celebrate his departure, Gandalf plans to set up a spectacular display of fireworks across the land.

The Shire has $$$n$$$ hobbit holes numbered $$$1$$$ to $$$n$$$, each of which is occupied by exactly one hobbit. Every hole $$$i \gt 1$$$ is connected by a lane directly to a unique hole $$$p_i$$$, with $$$p_i \lt i$$$, so that following the lanes always leads towards hole $$$1$$$, the town.

Illustration of the first sample.

Gandalf must place fireworks at a minimum number of hobbit holes so that every hobbit can see at least one firework. The fireworks have a visibility range $$$k$$$. A hobbit at hole $$$i$$$ can see a firework placed at hole $$$j$$$ if it is placed at their own hole, or if $$$j$$$ lies on the path from hole $$$i$$$ to the town and the number of lanes between $$$i$$$ and $$$j$$$ is strictly less than $$$k$$$.

Input

The input consists of:

  • One line with two integers $$$n$$$ and $$$k$$$ ($$$2 \leq n \leq 10^5$$$, $$$1 \le k \le n$$$), the number of hobbit holes and the firework range.
  • One line with $$$n-1$$$ integers $$$p_2, p_3, \ldots, p_n$$$ ($$$1 \le p_i \leq i-1$$$), where $$$p_i$$$ is the next hole reached when going from hole $$$i$$$ toward the town.
Output

Output one integer $$$m$$$, the minimum number of hobbit holes where a firework must be placed, followed by $$$m$$$ distinct integers, the indices of those holes.

If there are multiple ways to place the fireworks using the minimum number of holes, you may output any one of them.

Examples
Input
5 3
1 2 2 3
Output
2
1 5
Input
6 3
1 2 3 4 3
Output
2
1 3
Note

In the first sample, a firework at hole $$$1$$$, i.e. the town, can only be seen by the hobbits at holes $$$1$$$, $$$2$$$, $$$3$$$, and $$$4$$$. A second firework at hole $$$5$$$ can only be seen by the hobbit at hole $$$5$$$.

In the second sample, a firework at hole $$$1$$$ can only be seen by the hobbits at holes $$$1$$$, $$$2$$$, and $$$3$$$. A second firework at hole $$$3$$$ can only be seen by the hobbits at holes $$$3$$$, $$$4$$$, $$$5$$$, and $$$6$$$. So every hobbit can see at least one firework.