ll@w,@n,@a[n],@m,@b[m],x=1d4,c[x];rep(j,m)REP(rd_ll())c[m*rd_ll()-m+j]=x;maxflowg;g.malloc(3x,1);rep(i,n+m)g.addEdge(i