void main() {
    string b = readln.chomp;
    b == "A" && "T".writeln;
    b == "T" && "A".writeln;
    b == "C" && "G".writeln;
    b == "G" && "C".writeln;
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.container;
import std.typecons;