A company runs N servers around the world. Each server initially stores one unique piece of information: server i stores information i, and no two servers start with the same piece.
The company connects servers with communication lines so information can be shared. Whenever two servers become able to reach each other through the currently active lines, they synchronize: after synchronizing, every server in the same connected group holds the union of all pieces that any server in that group held. In other words, servers that are connected (directly or indirectly) always share exactly the same set of pieces.
To keep costs down, only N−1 lines are ever installed, and they are chosen so that, if all of them were active at the same time, the servers would form a single tree (there is a unique simple path between any two servers).
At time 0, no line is active. Because some lines run through harsh environments, a line may go down and later be rebuilt. At each time j (for 1≤j≤M) the state of exactly one line changes: if that line is currently inactive it becomes active, and if it is currently active it becomes inactive. All synchronization triggered by a change at time j finishes before time j+1.
Important: information is never lost. When an active line goes down and a group splits into two, each side keeps every piece it already held.
After all M changes have been applied, report, for several chosen servers, how many distinct pieces of information that server holds.
The input is given through standard input in the following format.
Print Q lines. The k-th line must contain a single integer: the number of distinct pieces of information held by server Ck after all M changes have been applied.
Consider the first sample, with 5 servers. At the start server i holds piece i (for 1≤i≤5).
In the end servers 1, 4, and 5 hold 3, 5, and 4 distinct pieces respectively, which matches the first sample's output.