import java.util.Scanner

import scala.annotation.tailrec

object Main {
  def main(args: Array[String]) = {
    val sc = new Scanner(System.in)
    val S = sc.nextLine()

    @tailrec
    def search(ch: Char, str: String, subStr: String = ""): String = {
      val n = ch match {
        case 'A' | 'C' | 'G' | 'T' => subStr + ch
        case _ => ""
      }
      if (n.isEmpty || str.isEmpty) subStr
      else search(str.head, str.tail, n)
    }

    val r = S.tails.map {s =>
      if (s.isEmpty) ""
      else search(s.head, s.tail)
    }.toList.map(_.length).sortWith((a, b) => a > b).head

    println(s"$r")
  }
}
