
class DoubleHelixAnswer
  def self.double_helix(data)
    case data
    when 'A'
      'T'
    when 'T'
      'A'
    when 'C'
      'G'
    when 'G'
      'C'
    end
  end
end

data = STDIN.read.strip
DoubleHelixAnswer.double_helix(data)