program kadai
implicit none
character(len=4) ::  s

read(*,*) s

if (s(1:1)==s(2:2) .or. s(2:2)==s(3:3) .or. s(3:3)==s(4:4)) then
    write(*,*) "Bad"
    stop
end if
write(*,*) "Good"

end program kadai
