For a tree T consisting of n vertices numbered from 1 to n, the compressed spanning subtree S(X) of a set X of spanned vertices (vertices that are not in X are called not spanned) can be defined by the following algorithm:
Formally, S(X) is the smallest subgraph of T containing all vertices in X and then having all other vertices of degree two or less smoothed out.

The tree from test 1, and its compressed spanning subtrees for X=3,4,6 and for X=2,5,6.
You are not given the tree T. Instead, your task is to find it. You can ask questions of the following form: "How many vertices does the compressed spanning subtree of X contain?". And since otherwise finding the tree by asking such questions would be impossible, there are no vertices incident to exactly two edges in T.