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: Accepted)

using System;
using System.Numerics;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Collections;

namespace debug
{
    class main
    {
        static void Main(string[] args)
        {
            //問題クラスを展開
            ProgramA a = new ProgramA();
            a.main();//実行する

        }

    }

    class ProgramA
    {
        public void main()
        {
            //入力
            string s = Console.ReadLine();

            //対になる塩基を出す
            if (s == "A")
                Console.WriteLine("T");
            else if (s == "T")
                Console.WriteLine("A");
            else if (s == "G")
                Console.WriteLine("C");
            else
                Console.WriteLine("G");

        }
    }

    class ProgramB
    {
        public void main()
        {

            //入力
            string s = Console.ReadLine();

            int ans = 0;

            //先頭から調べていく
            for (int i = 0; i < s.Length; i++)
            {
                if (s[i] != 'A' || s[i] != 'T' || s[i] != 'C' || s[i] != 'G')
                    continue;
                int count = 0;

                for (int j = i; j < s.Length; j++)
                {
                    if (s[i] == 'A' || s[i] == 'T' || s[i] == 'C' || s[i] == 'G')
                    {
                        count++;
                    }
                    else
                        break;
                }

                ans = Math.Max(ans, count);
            }

            //答え出力
            Console.WriteLine(ans);
            

        }
    }

    class ProgramC
    {
        public void main()
        {

            //入力
            string s = Console.ReadLine();

            //候補は101010....か0101010しかないので両方実験してみる
            int count1 = 0;
            int count2 = 0;
            //10101010
            for (int i = 0; i < s.Length; i++)
            {
                if (i % 2 == 0)
                    if (s[i] == '0')
                        count1++;
                if (i % 2 == 1)
                    if (s[i] == '1')
                        count1++;
            }

            //010101010
            for (int i = 0; i < s.Length; i++)
            {
                if (i % 2 == 0)
                    if (s[i] == '1')
                        count2++;
                if (i % 2 == 1)
                    if (s[i] == '0')
                        count2++;
            }

            //答えを出力

            Console.WriteLine(Math.Min(count1,count2));

        }


    }


    class ProgramD
    {
        public void main()
        {

            //入力
            string[] ss = Console.ReadLine().Split(' ');
            int n = int.Parse(ss[0]);
            int k = int.Parse(ss[1]);
            string s = Console.ReadLine();

            List<long> array = new List<long>();
            int flag = 0;

            //頭を記録しておく
            if (s[0] - '0' == 1)
                flag = 1;

            int count = 1;
            //1が続く数を連続で入れる
            for (int i = 1; i < n; i++)
            {
                if (s[i] != s[i - 1])
                {
                    array.Add(count);
                    count = 1;
                }
                else
                    count++;

                if (i == n - 1)
                    array.Add(count);
            }
            int num = array.Count;
            //ダミーを入れておく
            array.Add(0);
            array.Add(0);

            //入れた数が2*k + flag より少なければ全交換可能
            if (num <= 2 * k + flag)
            {
                Console.WriteLine(s.Length);
                return;
            }

            //kが0回のときは最大の続いているものを出す
            if(k == 0)
            {
                long ans2 = 0;
                if (flag == 0)
                {
                    for (int i = 0; i < num; i = i + 2)
                        ans2 = Math.Max(ans2, array[i + 1]);
                }
                else
                {
                    for (int i = 0; i < num; i = i + 2)
                        ans2 = Math.Max(ans2, array[i]);

                }
                Console.WriteLine(ans2);
                return;

            }

            long sum = 0;
            //それ以外は交換した個数を頭から比較（尺取り法）
            for (int i = 0; i < 2 * k + flag; i++)
                sum += array[i];
            //答を入れておく
            long ans = sum;

            for (int i = 2 * k + flag; i < num; i = i + 2)
            {
                //最初のときは頭によって場合分け
                if (i == 2 * k + flag)
                {
                    if (flag == 0)
                    {
                        sum -= array[0];
                        sum += array[2 * k];
                        sum += array[2 * k + 1];
                    }
                    else
                    {
                        sum -= array[0];
                        sum -= array[1];
                        sum += array[2 * k + 1];
                        sum += array[2 * k + 2];
                    }


                }
                else
                {
                    //それ以外は二個引いて二個足す
                    sum -= array[i - 2 * k];
                    sum -= array[i - 2 * k - 1];
                    sum += array[i];
                    sum += array[i + 1];
                }
                //最大を更新
                ans = Math.Max(ans, sum);
            }

            //答を出す
            Console.WriteLine(ans);

        }

    }

    


}