t = int(input()) for i in range(t): s = input() if "101" in s or "010" in s: print("Good") else: print("Bad")