def check_brackets(pathway, levels_brackets):
    """
    Function checks is this expression in brackets. Returns without if true
    Example: input (A B C)
            return: A B C
    :param pathway: input string expression
    :return: output string expression
    """
    L = len(pathway)
    if pathway[0] == '(' and pathway[L-1] == ')' and levels_brackets[0] == levels_brackets[L-1]:  # check brackets
        return pathway[1:L-1]
    else:
        return pathway