def is_paired(input_string):
    stack = list()
    brackets = {'{': '}', '[': ']', '(': ')'}
    for i in input_string:
        if i in brackets.keys():
            stack.append(i)
        elif i in brackets.values():
            if not stack:
                return False
            stack_top = stack.pop()
            if i != brackets[stack_top]:
                return False
    return not stack

8391a32868901e0c94fafe92d3980c550e38c350
<mask token>

def is_paired(input_string):
    stack = list()
    brackets = {'{': '}', '[': ']', '(': ')'}
    for i in input_string:
        if i in brackets.keys():
            stack.append(i)
        elif i in brackets.values():
            if not stack:
                return False
            stack_top = stack.pop()
            if i != brackets[stack_top]:
                return False
    return not stack
