Lots of geeky customers visit our chef's restaurant everyday. So, when asked to fill the feedback form, these customers represent the feedback using a binary string (i.e a string that contains only characters '0' and '1'. 

Now since chef is not that great in deciphering binary strings, he has decided the following criteria to classify the feedback as Good or Bad : 

If the string contains the substring "010" or "101", then the feedback is Good, else it is Bad. Note that, to be Good it is not necessary to have both of them as substring.

So given some binary strings, you need to output whether according to the chef, the strings are Good or Bad. 

-----Input-----
The first line contains an integer T denoting the number of feedbacks. Each of the next T lines contains a string composed of only '0'  and '1'.

-----Output-----
For every test case, print in a single line Good or Bad as per the Chef's method of classification.

-----Constraints-----
-  1 ≤  T ≤   100 
-  1  ≤  |S|   ≤  105 

Sum of length of all strings in one test file will not exceed 6*106.

-----Example-----
Input:
2
11111110
10101010101010

Output:
Bad
Good

-----Explanation-----
Example case 1.

The string doesn't contain 010 or 101 as substrings.

Example case 2.

The string contains both 010 and 101 as substrings.

Difficulty: interview

Starter code:

Solutions:
# cook your dish here
t=int(input())
for i in range(t):
 s=input()
 fl=-1
 n=len(s)
 for i in range(n-2):
  if(s[i:i+3]=="010" or s[i:i+3]=="101"):
   fl=0
   print("Good")
   break

 if(fl==-1):
  print("Bad")


# cook your dish here
t=int(input())
for i in range(t):
 s=input()
 fl=-1
 n=len(s)
 for i in range(n-2):
  if(s[i:i+3]=="010" or s[i:i+3]=="101"):
   fl=0
   print("Good")
   break

 if(fl==-1):
  print("Bad")


for _ in range(int(input())):
 input_1 = str(input())
 str1 = "010"
 str2 = "101"
 
 if input_1.find(str1) == -1 and input_1.find(str2)== -1:
  print("Bad")
 else: 
  print("Good")

# cook your dish here
for _ in range(int(input())):
 bstr = input()
 # if '101' in bstr or '010' in bstr:
 #     print("Good")
 # else:
 #     print("Bad")
 opval = "Bad"
 for i in range(len(bstr)-2):
  if bstr[i] == bstr[i+2] and bstr[i]!=bstr[i+1]:
   opval = "Good"
   break
 print(opval)

# cook your dish here
for _ in range(int(input())):
 bstr = input()
 if '101' in bstr or '010' in bstr:
  print("Good")
 else:
  print("Bad")

# cook y
for i in range(int(input())):
 s=input()
 p="Bad"
 for i in range(len(s)-2):
  if '0' in s[i] and '1' in s[i+1] and '0' in s[i+2]:
   p="Good"
  if '1' in s[i] and '0' in s[i+1] and '1' in s[i+2]:
   p="Good"
 print(p)
  


# cook your dish here
t = int(input())
for _ in range(t):
 s = input()
 if (("010" in s) or ("101" in s)):
  print("Good")
 else:
  print("Bad")


for _ in range(int(input())):
 s=input()
 if s.count('101')>0 or s.count('010')>0:
  print('Good')
 else:
  print('Bad')

for _ in range(int(input())):
 s=input()
 if s.count('101')>0 or s.count('010')>0:
  print('Good')
 else:
  print('Bad')

t=int(input())
while t:
 t=t-1
 n=input()
 if ("101" in n or "010" in n):
  print("Good")
 else:
  print("Bad")


# cook your dish here

for i in range(int(input().strip())):
 binst = input()
 result = "Bad"
 for i in range(len(binst)-2):
  st = binst[i:i+3]
  if st=='101' or st=='010':
   result = "Good"
   break

 print(result)


T = int(input())

for _ in range(T):
 string = input()
 if "101" in string or "010" in string:
  print("Good")
 else:
  print("Bad")

# binary string as the feedback form
# chef classifies each feedback as GOOD or BACK
t=int(input())
for i in range(t):
 s=input()
 ans=False
 for j in range(len(s)-2):
  if(s[j]=='0'):
   if(s[j+1]=='1'):
    if(s[j+2]=='0'):
     ans=True
     break
  else:
   if(s[j+1]=='0'):
    if(s[j+2]=='1'):
     ans=True
     break
 if(ans):
  print("Good")
 else:
  print("Bad")

# binary string as the feedback form
# chef classifies each feedback as GOOD or BACK
t=int(input())
for i in range(t):
 s=input()
 ans=False
 for j in range(len(s)-2):
  if(s[j]=='0'):
   if(s[j+1]=='1'):
    if(s[j+2]=='0'):
     ans=True
     break
  else:
   if(s[j+1]=='0'):
    if(s[j+2]=='1'):
     ans=True
     break
 if(ans):
  print("Good")
 else:
  print("Bad")

t = int(input())
for _ in range(t):
 n = input()
 if "010" in n:
  print("Good")
 elif "101" in n:
  print("Good")
 else:
  print("Bad")



# cook your dish here
for i in range(int(input())):
 s = input()
 if '101' in s:
  print("Good")
 elif '010' in s:
  print("Good")
 else:
  print("Bad")

for _ in range(int(input())):
 s=input()
 if '101' in s:
  print("Good")
 elif '010' in s:
  print("Good")
 else:
  print("Bad")

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

for _ in range(int(input())):
 i='101'
 j='010'
 n=input()
 if i in n or j in n:
  print('Good')
 else:
  print('Bad')

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

# cook your dish here
for _ in range(int(input())):
 n=input()
 good=['010','101']
 t=False
 for x in good:
  if x in n:
   print("Good")
   t=True
   break
 if not t:
  print("Bad")


# cook your dish here
for _ in range(int(input())):
 n=input()
 good=['010','101']
 t=False
 for x in good:
  if x in n:
   print("Good")
   t=True
   break
 if not t:
  print("Bad")
 


# cook your dish here
t=int(input())
while t>0:
 s=input()
 n=len(s)
 c=s.find('101',0,n)+s.find('010',0,n)
 if c==-2:
  print('Bad')
 else :
  print('Good')
 t=t-1


for _ in range(int(input())):
 s = input()
 flag = False
 if not s.find("101")==-1:
  flag = True
 elif not s.find("010")==-1:
  flag = True
 if(flag):
  print("Good")
 else:
  print("Bad")