n = eval(input());ans="ACGT";k=ans.index(n)^3;print((ans[k]))
n=eval(input());a="ACGT";print((a[a.index(n)^3]))
n = eval(input())
ans = "ACGT"
k = ans.index(n) ^ 3
print((ans[k]))

n = eval(input())
a = "ACGT"
print((a[a.index(n) ^ 3]))

-ans = "ACGT" -k = ans.index(n) ^ 3 -print((ans[k])) +a = "ACGT" +print((a[a.index(n) ^ 3]))