def trans(s)
  s.split('').map { |c|
    case c
      when 'A' then 'T'
      when 'T' then 'A'
      when 'G' then 'C'
      when 'C' then 'G'
    else 'X'
    end
    }.join
end

b = readline.chop
puts trans(b)