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

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

puts result