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# (Mono 4.6.2.0) (judge verdict: Runtime Error)

using System;

class Program
{
    public static void Main(string[] args)
    {
        int N, Q;
        string S;
        int[] ls;
        int[] rs;
        {
            {
                var nq = Console.ReadLine().Split(' ');
                N = int.Parse(nq[0]);
                Q = int.Parse(nq[1]);
            }
            S = Console.ReadLine();
            ls = new int[Q];
            rs = new int[Q];
            for (int i = 0; i < Q; i++)
            {
                {
                    var lr = Console.ReadLine().Split(' ');
                    ls[i] = int.Parse(lr[0]);
                    rs[i] = int.Parse(lr[1]);
                }
            }
        }

        int[] r = new int[S.Length + 1];
        {
            for (int i = 0; i < S.Length - "AC".Length + 1; i++)
            {
                r[i + 1] = r[i] + (S.Substring(i, 2) == "AC" ? 1 : 0);
            }
            for (int i = S.Length - "AC".Length + 1; i < S.Length; i++)
                r[i + 1] = r[i];
        }

        for (int i = 0; i < Q; i++)
        {
            Console.WriteLine(r[rs[i] - 1] - r[ls[i] - 1]);
        }
    }
}