program main implicit none integer::i=0,j,k character(4)::s do j=1,3 read*,s if(s=="BLUE")then i=i-1 else i=i+1 end if end do if(i<0)then print*,"BLUE" else print*,"RED" end if end program