import sys



corresponding = dict(list(zip('ACGT', 'TGCA')))



b = sys.stdin.readline().rstrip()



def main():

    return corresponding[b]



if __name__ == '__main__':

    ans = main()

    print(ans)
import sys



pair = dict(list(zip('ACGT', 'TGCA')))



b = sys.stdin.readline().rstrip()



def main():

    print((pair[b]))



if __name__ ==  '__main__':

    main()
import sys

corresponding = dict(list(zip("ACGT", "TGCA")))
b = sys.stdin.readline().rstrip()


def main():
    return corresponding[b]


if __name__ == "__main__":
    ans = main()
    print(ans)

import sys

pair = dict(list(zip("ACGT", "TGCA")))
b = sys.stdin.readline().rstrip()


def main():
    print((pair[b]))


if __name__ == "__main__":
    main()

-corresponding = dict(list(zip("ACGT", "TGCA"))) +pair = dict(list(zip("ACGT", "TGCA"))) -    return corresponding[b] +    print((pair[b])) -    ans = main() -    print(ans) +    main()