private int search(TreeNode root, String query, int d, int length){
		if(root == null) return length;
		if(root.value != null) length = d;
		if(d == query.length()) return length;
		char c = query.charAt(d);
		return search(root.next[c], query, d + 1, length);
	}