def group_check(s):
while '()' in s or '{}' in s or '[]' in s:
s=s.replace('()','')
s=s.replace('{}','')
s=s.replace('[]','')
return len(s)==0
print(group_check("()"))
print(group_check("({"))
print(group_check("({}{}[])"))
ZGVmIGdyb3VwX2NoZWNrKHMpOgogICAgd2hpbGUgJygpJyBpbiBzIG9yICd7fScgaW4gcyBvciAnW10nIGluIHM6CiAgICAgICAgcz1zLnJlcGxhY2UoJygpJywnJykKICAgICAgICBzPXMucmVwbGFjZSgne30nLCcnKQogICAgICAgIHM9cy5yZXBsYWNlKCdbXScsJycpCiAgICByZXR1cm4gbGVuKHMpPT0wCiAgICAKICAgIAogICAgCnByaW50KGdyb3VwX2NoZWNrKCIoKSIpKQpwcmludChncm91cF9jaGVjaygiKHsiKSkKcHJpbnQoZ3JvdXBfY2hlY2soIih7fXt9W10pIikp