function Main(input) {
  var output = '';

  switch (input) {
    case 'A':
      output = 'T';
      break;
    case 'T':
      output = 'A';
      break;
    case 'C':
      output = 'G';
      break;
    case 'G':
      output = 'C';
      break;
  }

  console.log('%s', output);
}
Main(require('fs').readFileSync('/dev/stdin', 'utf8'));
