private static Node findSuccessor(Node r, Node t) {
		if (t.right != null) {
			Node p = t.right;
			while (p.left != null) {
				p = p.left;
			}
			return p;
		} else {
			Node p = r;
			Node prev = null;
			while (p != t) {
				if (p == null)
					return null;
				if (p.v > t.v) {
					prev = p;
					p = p.left;
				} else {
					p = p.right;
				}
			}
			return prev.v>t.v?prev:null;
		}
	}