public static List<Node> bfs_helper(Node c, Queue<Edge>pq) {
		Queue<Node> q=new ArrayDeque<>();
		Set<Node> v=new HashSet<>();
		List<Node> rel=new ArrayList<>();
		q.offer(c); v.add(c); rel.add(c);		
		while (!q.isEmpty()) {
			for (int i=0, n=q.size();i<n;++i) {
				Node t=q.poll();
				for (Edge e:t.edge) {
					Node other=e.a==t?e.b:e.a;
					if(!v.contains(other)) {
						pq.offer(e);
						v.add(other);
						rel.add(other);
					}
				}
			}
		}
		return rel;
	}