program main
implicit none
character(len=1) :: c

read(*,*) c
if( c=='A')then
write(*,'(a1)') 'T'
else if ( c =='T')then
write(*,'(a1)') 'A'
else if ( c == 'C')then
write(*,'(a1)') 'G'
else if ( c == 'G')then
write(*,'(a1)') 'C'
end if


end program main
