public int getSolution(TreeElement node) throws IncorrectSymbol, WrongStructure, ImpossibleAction {
        TreeElement left = node.getLeftSon();
        TreeElement right = node.getRightSon();

        if (right.isDigit() && left.isDigit()) {
            return computation(node.getOperation(), left.getValue(), right.getValue());
        }

        if (right.isDigit() && left.isOperation()) {
            int leftValue = getSolution(left);
            return computation(node.getOperation(), leftValue, right.getValue());
        }

        if (right.isOperation() && left.isDigit()) {
            int rightValue = getSolution(right);
            return computation(node.getOperation(), left.getValue(), rightValue);
        }

        if (right.isOperation() && left.isOperation()) {
            int leftValue = getSolution(left);
            int rightValue = getSolution(right);
            return computation(node.getOperation(), leftValue, rightValue);
        }
        throw new WrongStructure("Wrong input structure!");
    }