b = gets.to_s
a = "A"
t = "T"
g = "G"
c = "C"

if b == a
    puts "T".gsub(/(\r\n?|\n)/,"")
elsif b == t
    puts "A".gsub(/(\r\n?|\n)/,"")
elsif b == g
    puts "C".gsub(/(\r\n?|\n)/,"")
elsif b == c
    puts "G".gsub(/(\r\n?|\n)/,"")
end
