#include using namespace std; #define rep(i, n) for (int i=0; i>i)&1) cnt[i] = 1; for (int i=1; i bits[N+1]; rep(S, 1<>i)&1) c++; bits[c].pb(S); } rep(i, N) reverse(bits[i].begin(), bits[i].end()); rep(t, N) { int L; cin >> L; int A[L]; rep(i, L) cin >> A[i]; rep(i, L) A[i]--; for (int S : bits[t]) { for (int Ai: A) { if ((S>>Ai)&1) continue; dp[S|(1<