# Add or remove imports
from yogi import scan

print("\n=== Public tests by Jutge ===")
      
# Change 'function_name' to your function name,
# and addapt the way input must be read to your needs.
x = scan(str)
while x is not None:
    print(balanced(x))
    x = scan(str)

# add some constant tests in case they consumed all input
print("\n=== Additional public tests by Jutge ===")
s = "()()())))("
print(f"balanced('{s}') = {balanced(s)}")
s = "(((((()))))())"
print(f"balanced('{s}') = {balanced(s)}")
s = "((()"
print(f"balanced('{s}') = {balanced(s)}")
