String findNearest(String previous, int index, int maxShapes) {
            if (previous == null || previous.length() <= index) {
                // Select or create new
                // Checks all exists
                Character c = this.findEmpty(maxShapes);
                //if no
                if (c != null) {
                    return previous + symbol + c;
                } else {
                    // Search empty in deep
                    for (int i = 0; i < maxShapes; i++) {
                        String s = children.get(SHAPES[i]).findNearest(previous, index + 1, maxShapes);
                        if (s != null) {
                            if (parent != null) {
                                s = symbol + s;
                            }
                            return s;
                        }
                    }
                }
            } else {
                if (id != 0 || parent == null) {
                    Node node = children.get(previous.charAt(index));
                    if (node == null) {
                        node = new Node(previous.charAt(index), 0);
                        children.put(previous.charAt(index), node);
                        return previous + node.findEmpty(maxShapes);
                    }
                    return node.findNearest(previous, index + 1, maxShapes);
                } else {
                    return null;
                }
            }
            return null;
        }