program prob1
    implicit none
    character :: s
    read(*,*) s
    if(s == 'A') then
        write(*,*) 'T'
    else if(s == 'T') then
        write(*,*) 'A'
    else if(s == 'G') then
        write(*,*) 'C'
    else if(s == 'C') then
        write(*,*) 'G'
    end if
    stop
contains
end program prob1