output_description: If S is hard to enter, print `Bad`; otherwise, print `Good`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      S
attempt: n = int(input())
  a = []
  b = []
  gap = 0
  e = 0
  f = 0
  m = 0
  for i in range(n):
      c, d = map(int, input().split())
      a.append(c)
      b.append(d)
  while gap <= n / 9:
      gap = gap * 3 + 1
  while gap > 0:
      for i in range(gap, n):
          key = b[i]
          l = a[i]
          if key < b[i - gap]:
              j = i
              while True:
                  b[j] = b[j - gap]
                  a[j] = a[j - gap]
                  j -= gap
                  if j < gap or key >= b[j - gap]:
                      break
              b[j] = key
              a[j] = l
          gap = int((gap - 1) / 3)
  for i in range(n):
      e += a[i]
      if e > b[i]:
          m = 1
  if m == 1:
      print("No")
  else:
      print("Yes")
  
problem_description: Statement
  
  The door of Snuke's laboratory is locked with a security code.
  
  The security code is a 4-digit number. We say the security code is _hard to
  enter_ when it contains two consecutive digits that are the same.
  
  You are given the current security code S. If S is hard to enter, print `Bad`;
  otherwise, print `Good`.
samples: [{"input": "3776", "output": "Bad\n    \n\nThe second and third digits are the same, so 3776 is hard to enter.\n\n* * *"}, {"input": "8080", "output": "Good\n    \n\nThere are no two consecutive digits that are the same, so 8080 is not hard to\nenter.\n\n* * *"}, {"input": "1333", "output": "Bad\n    \n\n* * *"}, {"input": "0024", "output": "Bad"}]