private void flip(int node, int[] a, List<Node> nodes, Set<Integer> seen, boolean[] f){

			int nn = node;
			seen.add(node);
			for(Integer c1 : nodes.get(nn).children){
				if(seen.contains(c1))
					continue;
				for(Integer c2 : nodes.get(c1).children){
					if(!seen.contains(c2)){
						f[c2-1]=!f[c2-1];
					}
				}
			}
			a[nn-1]=a[nn-1]==0?1:0;
//			System.out.println("changed "+(node-1)+" to"+a[node-1]);
		}