program aaa
implicit none

character(1),dimension(4) :: g=['A','C','G','T']
character(1) :: s

read*, s

if(s==g(1)) write(*,'(a1)') g(4)
if(s==g(2)) write(*,'(a1)') g(3)
if(s==g(3)) write(*,'(a1)') g(2)
if(s==g(4)) write(*,'(a1)') g(1)

end program