#include #include #include struct input_structure{ int n; long long m; std::vector k; std::vector> A; std::vector> B; std::vector C; input_structure(){ std::cin >> n >> m; k.resize(n); A.resize(n); B.resize(n); C.resize(n); for(int i=0;i> k[i] >> C[i]; A[i].resize(k[i]); B[i].resize(k[i]); for(int j=0;j> A[i][j]; for(int j=0;j> B[i][j]; } } friend std::ostream& operator<<(std::ostream &os,input_structure &in){ std::cout << in.n << ' ' << in.m << '\n'; for(int i=0;i g(in.n+2); for(int i=0;i