Output #1
2
1
-1
4
2
-1
* In the first query, an edge is added between vertices $1$ and $2$.
* In the second query, two vertices are connected to vertex $1$: $1$ and $2$. Among them, the $1$\-st largest vertex number is $2$, which should be printed.
* In the third query, two vertices are connected to vertex $1$: $1$ and $2$. Among them, the $2$\-nd largest vertex number is $1$, which should be printed.
* In the fourth query, two vertices are connected to vertex $1$: $1$ and $2$, which is fewer than $3$, so print `-1`.
* In the fifth query, an edge is added between vertices $1$ and $3$.
* In the sixth query, an edge is added between vertices $2$ and $3$.
* In the seventh query, an edge is added between vertices $3$ and $4$.
* In the eighth query, four vertices are connected to vertex $1$: $1,2,3,4$. Among them, the $1$\-st largest vertex number is $4$, which should be printed.
* In the ninth query, four vertices are connected to vertex $1$: $1,2,3,4$. Among them, the $3$\-rd largest vertex number is $2$, which should be printed.
* In the tenth query, four vertices are connected to vertex $1$: $1,2,3,4$, which is fewer than $5$, so print `-1`.