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);
		if(root.children.containsKey(c)){
			return search(root.children.get(c), query, d + 1, length);
		}
		else
			return d;
	}