object Main extends App {
  val in = scala.io.Source.stdin.getLines.toSeq
  val B = in.head
  
  val ret = B.map{ e =>
    e match {
      case 'A' => 'T'
      case 'T' => 'A'
      case 'C' => 'G'
      case 'G' => 'C'
    }
 }
 println(ret)
}
