



def      _lowerCAmelCase(	__A			):
  UpperCAmelCase					      =  []
  UpperCAmelCase					      =  set({"(", "[", "{"}			)
  UpperCAmelCase					      =  set({")", "]", "}"}			)
  UpperCAmelCase					      =  {"{": "}", "[": "]", "(": ")"}

  for i in range(len(__A			)			):
    if s[i] in open_brackets:
      stack.append(s[i]			)

    elif s[i] in closed_brackets and (
        len(__A			) == 0 or (len(__A			) > 0 and open_to_closed[stack.pop()] != s[i])
    ):
      return False

  return len(__A			) == 0
def      _lowerCAmelCase(	):
  UpperCAmelCase					      =  input("Enter sequence of brackets: "			)
  if is_balanced(__A			):
    print(__A   ,       "is balanced"			)
  else:
    print(__A   ,       "is not balanced"			)


if __name__ == "__main__":
      main()






def      _lowerCAmelCase(	__A   ,       __A   ,       __A			):
  if n == 0:
    return 1

  elif n % 2 == 1:
    return (binary_exponentiation(__A   ,       n - 1   ,       __A			) * a) % mod

  else:
    UpperCAmelCase					      =  binary_exponentiation(__A   ,       n / 2   ,       __A			)
    return (b * b) % mod


# a prime number
lowerCAmelCase__       = 701

lowerCAmelCase__       = 1000000000
lowerCAmelCase__       = 10

# using binary exponentiation function, O(log(p)):
print((a / b) % p == (a * binary_exponentiation(b, p - 2, p)) % p)





print((a / b) % p == (a * b ** (p - 2)) % p)



