Problem:
Score : 100 points

Problem Statement

On the Planet AtCoder, there are four types of bases: A, C, G and T. A bonds with T, and C bonds with G.

You are given a letter b as input, which is A, C, G or T. Write a program that prints the letter representing the base that bonds with the base b.

Constraints

b is one of the letters A, C, G and T.

Input

Input is given from Standard Input in the following format:

b

Output

Print the letter representing the base that bonds with the base b.

Sample Input 1

A

Sample Output 1

T

Sample Input 2

G

Sample Output 2

C

Solution in C++14 (GCC 5.4.1) (judge verdict: Runtime Error)

#include <bits/stdc++.h>

#define ll long long

#define rep(i, a, b) for (int i = a; i < b; i++)
#define For(i, a, b) for (int i = a; i <= b; i++)

using namespace std;

const int mod = 1000000000 + 7;
const int MAXN = 100000 + 5;

char s[MAXN];
int acOcc[MAXN];

int main() {
    int n, q;
    scanf("%d%d", &n, &q);
    scanf("%s", s);
    for (int i = 1; i < n; i++) {
        acOcc[i] = acOcc[i - 1];
        if (s[i] == 'C' && s[i - 1] == 'A')
            acOcc[i]++;
    }
    while (q-- > 0) {
        int l, r;
        scanf("%d%d", &l, &r);
        printf("%d\n", acOcc[r - 1] - acOcc[l - 1]);
    }
}