static void dfs(int u, int depth, int modifiedEven, int modifiedOdd){
        if(depth%2==0){
            if(modifiedEven%2==(label[u]==target[u]?1:0)){
                result++;
                modifiedEven++;
                picked.add(u);
            }
        } else{
            if(modifiedOdd%2==(label[u]==target[u]?1:0)){
                result++;
                modifiedOdd++;
                picked.add(u);
            }
        }
        for(int i=d[u]; i<d[u+1]; i++){
            int v = edges[i];
            if(parent[u]!=v){
                parent[v]=u;
                dfs(v, depth+1, modifiedEven, modifiedOdd);
            }
        }
    }