program main
  implicit none

  integer s,a,b,c,d

  read(*,*)s
  a = s/1000
  b = s/100 - a*10
  c = s/10 - a*100 - b*10
  d = s - a*1000 - b*100 - c*10
  
  if ((a == b) .or. (b == c)) then
    write(*,*)"Bad"
    stop
  else if (c == d) then
    write(*,*)"Bad"
    stop
  end if
  write(*,*)"Good"
end program main