program main
   implicit none
   character a
   read(*,*)a
   if(a=="A")then
      write(*,*)"T"
   endif
   if(a=="T")then
      write(*,*)"A"
   endif
   if(a=="C")then
      write(*,*)"G"
   endif
   if(a=="G")then 
      write(*,*)"C"
   endif
end program main
