text: Input In the first line of input, there are two integers n, m (1 ≤ n, m ≤ 5 ⋅ 10^5) denoting the number of vectors in S and the number of dimensions.Next n lines contain the description of the vectors in S.In each of them there is an integer k (1 ≤ k ≤ 2) and then follow k distinct integers x_1, ...x_k (1 ≤ x_i ≤ m).This encodes an m-dimensional vector having 1s on coordinates x_1, ...x_k and 0s on the rest of them.Among the n vectors, no two are the same.Output In the first line, output two integers: remainder modulo 10^9+7 of |T| and |S'|.In the second line, output |S'| numbers, indices of the elements of S' in ascending order.The elements of S are numbered from 1 in the order they are given in the input.Examples Input 3 2 1 1 1 2 2 2 1 Output 4 2 1 2 Input 2 3 2 1 3 2 1 2 Output 4 2 1 2 Input 3 5 2 1 2 1 3 1 4 Output 8 3 1 2 3 Note In the first example we are given three vectors: * 10 * 01 * 11 It turns out that we can represent all vectors from our 2-dimensional space using these vectors: * 00 is a sum of the empty subset of above vectors; * 01 = 11 + 10, is a sum of the first and third vector; * 10 = 10, is just the first vector; * 11 = 10 + 01, is a sum of the first and the second vector.Hence, T = \{00, 01, 10, 11\}.We can choose any two of the three vectors from S and still be able to obtain all the vectors in T.In such a case, we choose the two vectors which appear first in the input.Since we cannot obtain all vectors in T using only a single vector from S, |S'| = 2 and S' = \{10, 01\} (indices 1 and 2), as set \{1, 2 \} is lexicographically the smallest.We can represent all vectors from T, using only vectors from S', as shown below: * 00 is a sum of the empty subset; * 01 = 01 is just the second vector; * 10 = 10 is just the first vector; * 11 = 10 + 01 is a sum of the first and the second vector.# Solution #include <bits/stdc++.