const fs = require('fs');
const input = fs.readFileSync('/dev/stdin', 'utf8');

switch (input) {
  case 'A':
    console.log('T');
    break;
  case 'T':
    console.log('A');
    break;
  case 'C':
    console.log('G');
    break;
  case 'G':
    console.log('C');
    break;
}