print((*["A" if x=="T" else "T" if x=="A" else "C" if x=="G" else "G" for x in str(eval(input()))]))
print(({"A":"T","T":"A","G":"C","C":"G"}[eval(input())]))
print(
    (
        *[
            "A" if x == "T" else "T" if x == "A" else "C" if x == "G" else "G"
            for x in str(eval(input()))
        ]
    )
)

print(({"A": "T", "T": "A", "G": "C", "C": "G"}[eval(input())]))

-print( -    ( -        *[ -            "A" if x == "T" else "T" if x == "A" else "C" if x == "G" else "G" -            for x in str(eval(input())) -        ] -    ) -) +print(({"A": "T", "T": "A", "G": "C", "C": "G"}[eval(input())]))