function main(input) {
    const b = input;

    switch(b) {
        case 'A':
            console.log('T');
            break;
        case 'T':
            console.log('A')
            break
        case 'G':
            console.log('C')
            break
        case 'C':
            console.log('G')
            break;
    }
    return;
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

