BRACES = { '(': ')', '[': ']', '{': '}' }

def group_check(s):
    stack = []
    for b in s:
        c = BRACES.get(b)
        print("inside loop. stack: %s, b: %s" % (str(stack), b))
        print("not stack: %s" % str(not stack))
        if c:
            stack.append(c)
        elif not stack or stack.pop() != b:
            return False
    print("before return. stack: %s" % str(stack))
    return not stack
    
    
    
# print(group_check("()"))
# print(group_check("({"))
print(group_check("({}{}[])"))