private static <S> TreeNode<S> seekAccept(ArrayDeque<TreeNode<S>> stack) {
		while (!stack.isEmpty()) {
			TreeNode<S> top = stack.pop();
			stack.addAll(top.children);
			if (top.isAccept()) {
				return top;
			}
		}
		return null;
	}