program prob1
    implicit none
    character(1)::b
    read(*,*) b
    if(b .eq. 'A') then
        write(*,'(a)') 'T'
    else if(b .eq. 'T') then
        write(*,'(a)') 'A'
    else if(b .eq. 'C') then
        write(*,'(a)') 'G'
    else
        write(*,'(a)') 'C'
    end if
    stop
end program