// #include #include using namespace std; using namespace atcoder; using ll = long long; #define rep(i, n) for (int i=0; i<(int)(n); ++(i)) #define rep3(i, m, n) for (int i=(m); (i)<(int)(n); ++(i)) #define repr(i, n) for (int i=(int)(n)-1; (i)>=0; --(i)) #define rep3r(i, m, n) for (int i=(int)(n)-1; (i)>=(int)(m); --(i)) #define all(x) (x).begin(), (x).end() const int INF = (int)(1e9); int main() { int n = 19; vector a(n); rep(i, n) { int li; cin >> li; rep(j, li) { int ai; cin >> ai; --ai; a[i] |= 1 << ai; } } vector> dp(1<(2)); dp[0][0] = 1; rep(i, (1<