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



Sample input:
A


Sample output:
T

Submission status: Runtime Error

Solution code:
b = input()
if b=='A':
    print ('T')
elif b = 'T':
    print ('A')
elif b = ('C'):
    print ('G')
else:
    print ('C')

Submission status: Runtime Error

Solution code:
a=input()
if a=="A":
    print("T")
else if a=="T":
    print("A")
else if a=="C":
    print("G")
else if a=="G":
    print("C")

Submission status: Runtime Error

Solution code:
dic = {"A" : "T", "T" : "A", "C" : "G", "G" : "C"}
print(dict[input()])

Submission status: Runtime Error

Solution code:
B=input()
print("T" if B=="A" else "A" if B=="T" else "G" if B=="C" else "C" if B=="G")

Submission status: Runtime Error

Solution code:
b=input()
print("T" if B=="A" else "A" if B=="T" else "G" if B=="C" else "C" if B=="G")

Submission status: Runtime Error

Solution code:
b=input()
print("T" if B="A" else "A" if B="T" else "G" if B="C" else "C" if B="G")

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;
int main(){
	char a;
	cin>>a;
	switch(a){
		case "A":cout<<"T"<<endl;break;
		case "T":cout<<"A"<<endl;break;
		case "C":cout<<"G"<<endl;break;
		case "G":cout<<"C"<<endl;break;
	}
	return 0;
}

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;
int main(){
	char a;
	cin>>a;
	switch(a){
		case "A":cout<<"T"<<endl;
		case "T":cout<<"A"<<endl;
		case "C":cout<<"G"<<endl;
		case "G":cout<<"C"<<endl;
	}
	return 0;
}

Submission status: Runtime Error

Solution code:
n,q=map(int,input().split())

s=input()
lr=[]

for _ in range(q):
    l,r=map(int,input().split())
    lr.append((l,r))
    
def count_x(s):
    count=0
    for i in range(len(s)):
        if s[i]=="x":
            count+=1
    return count

for l,r in lr:
    total=0
    print(count_x(s[l-1:r].replace("AC","x")))

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline

n, q = map(int, input().split())
s = input()
for _ in range(q):
  first, last = map(int, input().split())
  print(s[first-1:last].count("AC"))

Submission status: Runtime Error

Solution code:
N, Q = map(int, input().split())
S = str(input())
SD = [0]*N

for n in range(N - 1):
    SD[n] = S[n]+S[n+1]

for q in range(Q):
    l, r = map(int, input().split())
    cnt = 0
    print(SD[l-1:r-1].count("AC"))

Submission status: Runtime Error

Solution code:
b=raw_input()

if b in {'A','T'}:
    if b == 'A':
        print('T')
    else:
        print('A')
elif b in {'G','C'}:
    if b == 'G':
        print('C')
    elif b=='C':
        print('G')

Submission status: Runtime Error

Solution code:
b=raw_input()
#b=str(b_in)
if b=="A":
  print("T")
elif b=="G":
  print("C")
elif b=="T":
  print("A")
elif b=="C":
  print("G")

Submission status: Runtime Error

Solution code:
b=map(str.input())
if b=="A":
  print("T")
elif b="G":
  print("C")
elif b=="T":
  print("A")
elif b=="C":
  print("G")

Submission status: Runtime Error

Solution code:
import sys
N,Q = map(int,sys.stdin.readline().rstrip().split())
S = sys.stdin.readline().rstrip()
for _ in range(Q):
  l,r  = map(int,sys.stdin.readline().rstrip().split())
  print(S[l-1:r].count("AC"))
  del l
  del r

Submission status: Runtime Error

Solution code:
N,Q = list(map(int,input().split()))
S = input()
L = []
R = []
for i in range(Q):
    a = list(map(int,input().split()))
    L.append(a[0])
    R.append(a[1])

S_count = []
count = 0
A_flag = False

for i in range(len(S)):
    if A_flag == True:
        if S[i] == "C" :
            count += 1
        A_flag = False
    else:
        if S[i] == "A" :
            A_flag = True
        else:
            A_flag = False
    S_count.append(count)

for i in range(Q):
    print(S_count[R[i] - 1] - S_count[L[i] - 1])

Submission status: Runtime Error

Solution code:
b = input()
aa = {"A":"T","T":"A","G":"C","C","G"}
print(aa[b])

Submission status: Runtime Error

Solution code:
ATCG

enki = input()
if enki == "A":
  return "T"
elif enki == "T":
  return "A"
elif enki == "C":
  return "G"
elif enki == "G":
  return "C"

Submission status: Runtime Error

Solution code:
bases={
  'A':'T',
  'T':'A',
  'C':'G',
  'G':'C'
}
b=input()
print(bases(b))

Submission status: Runtime Error

Solution code:
bases={
  'A':'T',
  'T':'A',
  'C':'G',
  'G':'C'
}

print(bases(input()))

Submission status: Runtime Error

Solution code:
a=input()

if a="A" or "T":
    if a=="T":
        b="A"
    if a=="A":
        b="T"

if a="C" or "G":
    if a=="C":
        b="G"
    if a=="G":
        b="C"

print(b)

Submission status: Runtime Error

Solution code:
A = input()
if A == 'A'
  print('T')
elif A == 'T'
  print('A')
elif A == 'C'
  print('G')
elif A == 'G'
  print('C')

Submission status: Runtime Error

Solution code:
A = input()
if A = 'A':
    print ('T')
elif A = 'T':
    print ('A')
elif A = 'G':
    print ('C')
else:
    print('G')

Submission status: Runtime Error

Solution code:
map={'A':'T','C':'G','G':'C','T':'A'}
inp=input()
return map[inp]

Submission status: Runtime Error

Solution code:
N, Q = map(int, input().split())
S = input()
t=[0]*(N+1)
for i in range(N):
    t[i + 1] = t[i] + (1 if S[i : i + 2] == 'AC' else 0)
for i in range(Q):
    l, r = map(int, input().split())
    print(t[r-1] - t[l-1])

Submission status: Runtime Error

Solution code:
N,Q = input().split()
Q = int(Q)
S = input()

list1 = []

for i in range(Q):
    l,r = map(int,input().split())
    l = l - 1
    list1.append(S[l:r].count('AC'))

for i in list1:
    print(i)

Submission status: Runtime Error

Solution code:
b = input()
if b=="A":
  print("T")
elif b=="T":
  print("A")
elif b=="G":
  print("C")
else
  print("G")

Submission status: Runtime Error

Solution code:
b = input()
if b == A:
  print(T)
elif b == T:
  print(A)
elif b == C:
  print(G)
else:
  print(C)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Fri Apr  5 17:16:14 2019

@author: adachi-lab
"""

input_1 = input()
S = input()
l = []
r = []


N = input_1.split()[0]
Q = input_1.split()[1]

for i in range(int(Q)):
    input_3 = input()
    l.append(int(input_3.split()[0]))
    r.append(int(input_3.split()[1]))

W = [(S[x-1:y]).count('AC') for (x, y) in zip(l, r)]

for i in range(len(W)):
    print(W[i])

Submission status: Runtime Error

Solution code:
N,Q=map(int,input().split())
S=input()
l=list(S)
n=[0]*(N-1)
for i in range(N-1):
    if l[i]=='A':
        if l[i+1]=='C':
            n[i]=1
for i in range(Q):
    l,r=map(int,input().split())
    print(sum(n[l-1:r-1]))

Submission status: Runtime Error

Solution code:
a = input(b)
b = {"A" : "T", "G" : "C", "T" : "A", "C" : "G"}

print(c[b])

Submission status: Runtime Error

Solution code:
b=input()
a=['A','C','G','T']
b=['A','T','C','G']
i=a.index(b)
print(b[i])

Submission status: Runtime Error

Solution code:
_, num_query = list(map(int,input().split()))
string = input()
dfor _ in range(num_query):
  left, right = list(map(int,input().split()))
  sub_string = string[left-1:right]
  print(sub_string.count("AC"))

Submission status: Runtime Error

Solution code:
base = input()
if base == "A"
	print("T")
if base == "T"
	print("A")
if base == "C"
	print("G")
if base == "G"
	print("C")

Submission status: Runtime Error

Solution code:
N, Q = map(int,input().split())
S = input()

count_list = [0]*(N+1)

for i in range(N):
    if S[i:i+2] == 'AC':
        count_list[i+1] = count_list[i] + 1
    else:
        count_list[i+1] = count_list[i]

for i in range(Q):
    l, r = map(int,input().split())
    print(count_list[r-1] - count_list[l-1])

Submission status: Runtime Error

Solution code:
n, q = map(int, input().split())
s = input()
l = [0] * q
r = [0] * q
for i in range(0, q):
    l[i], r[i] = map(int, input().split())
ac_index = [False] * n
for i in range(n - 1):
    if s[i] + s[i + 1] == 'AC':
        ac_index[i] = True
for i in range(0, q):
    count = 0;
    for j in range(l[i] - 1, r[i] - 1):
        if ac_index[j]:
            count += 1
    print(count)

Submission status: Runtime Error

Solution code:
b = input()
 
if  "A"==b
    print("T")
elif "C"==b
    print("G")
elif "T"==b
    print("A")
else:
    print("C")

Submission status: Runtime Error

Solution code:
b = input()

if b == "A"
    print("T")
elif b == "C"
    print("G")
elif b == "T"
    print("A")
else:
    print("C")

Submission status: Runtime Error

Solution code:
N,Q=map(int,input().split())
S=input()
out=''
for i in range(Q):
    l,r=map(int,input().split())
    out+=str(S[l-1:r].count('AC'))+'\n'
print(out[:-1])

Submission status: Runtime Error

Solution code:
acid = {'A': 'T', 'T': 'A', 'G': 'C', 'C': 'G'}
c = input()
print(acid(c))

Submission status: Runtime Error

Solution code:
b = input()

if b == 'A'{
  print('T')
}else if b =='T'{
  print('A')
}else if b == 'C'{
  print('C')
}else{
  print('G')
}

Submission status: Runtime Error

Solution code:
s = input()
p = s.replace('A','B')
q = p.replace('T','A')
r = q.replace('B','T')
w = r.replace('G','W')
x = w.replace('C','G')
y = x.replace('W','C')
print(y)
~

Submission status: Runtime Error

Solution code:
n,q = map(int,input().split())
s = input()
m = [list(map(int,input().split())) for i in range(q)]
count = [0]*(N+1)
 
for i in range(n):
    if S[i:i+2] == 'AC':
        comu[i+1] = comu[i] + 1
    else:
        comu[i+1] = comu[i]
 
for l,r in list:
    print(count[r-1]-count[l-1])

Submission status: Runtime Error

Solution code:
n,q = map(int(input().split()))
s = input()
m = list(map(int,input().split for i in range(q)))
count = [0]*(N+1)

for i in range(n):
    if S[i:i+2] == 'AC':
        comu[i+1] = comu[i] + 1
    else:
        comu[i+1] = comu[i]

for l,r in list:
    print(count[r-1]-count[l-1])
~

Submission status: Runtime Error

Solution code:
n,q = map(int(input().split()))
s = input()
m = list(map(int,input().split for i in range(q)))
count = [0]*(N+1)

for i in range(N):
    if S[i:i+2] == 'AC':
        comu[i+1] = comu[i] + 1
    else:
        comu[i+1] = comu[i]

for l,r in list:
    print(count[r-1]-count[l-1])

Submission status: Runtime Error

Solution code:
b = input()
if b == 'A':
  print('T')
elif b == 'T':
  print('A')
elif b == 'C':
  print('G')
elif b == 'G':
  print('C'):

Submission status: Runtime Error

Solution code:
input = raw_input()

base = {"A":"T", "T":"A", "C":"T", "T":"C"}

print base[input]

Submission status: Runtime Error

Solution code:
b = int(input())

if b == "A":
	print("T")
elif b == "C":
	print("G")
elif b == "G":
	print("C")
else:
	print("A")

Submission status: Runtime Error

Solution code:
N,Q=[int(n) for n in input().split(' ')]
S=input()
a=''
for i in range(Q):
  l,r=[int(n) for n in input().split(' ')]
  a=a+str(S[l-1:r].count('AC'))+'\n'
print(a)

Submission status: Runtime Error

Solution code:
str = input()

if (str == 'A'):
  print('T')
else if (str == 'T'):
  print('A')
else if (str == 'C'):
  print('G')
else:
  print('C')

Submission status: Runtime Error

Solution code:
N, Q = map(int, input().split())
S = input()
l = [0] * Q
r = [0] * Q
for i in range(Q):
    l[i], r[i] = map(int, input().split())
counter = [0] * N

for i in range(N-1):
    if S[i:i+2] == 'AC':
        counter[i+1] += counter[i] + 1
    else:
        counter[i+1] += counter[i]

for i in range(Q):
    print(counter[r[i]-1] - counter[l[i]-1])

Submission status: Runtime Error

Solution code:
import re
N, Q = (int(i) for i in input().split(' ')) 
S = input()
for i in range(Q):
    l_i, r_i = (int(j) for j in input().split())
    matches = re.findall('AC', S[l_i-1:r_i])
    print(len(matches))

Submission status: Runtime Error

Solution code:
b = input()
if b == 'A':
    print(T)
elif b == 'T':
    print(A)
elif b == 'C':
    print(G)
else:
    print(C)

Submission status: Runtime Error

Solution code:
b = int(input())
if b == "A":
  print("T")
elif b == "C":
  print("G")
elif b == "G":
  print("C")
else:
  print("A")

Submission status: Runtime Error

Solution code:
    b = input()
     
    if b == 'A': print('T')
    if b == 'T': print('A')
    if b == 'C': print('G')
    if b == 'G': print('C')

Submission status: Runtime Error

Solution code:
        b = input()
         
        if b == 'A' : print('T')
        if b == 'T' : print('A')
        if b == 'C' : print('G')
        if b == 'G' : print('C')

Submission status: Runtime Error

Solution code:
    b = input()
     
    if b == 'A'
    	print('T')
    if b == 'T'
    	print('A')
    if b == 'C'
    	print('G')
    if b == 'G'
    	print('C')

Submission status: Runtime Error

Solution code:
b = input()

if b == 'A'
	print('T')
elif b == 'T'
	print('A')
elif b == 'C'
	print('G')
elif b == 'G'
	print('C')

Submission status: Runtime Error

Solution code:
a=input()
if a=="A":
  print(T)
elif a!="A":
  print(A)
elif a=="C":
  print(G)
else:
  print(C)

Submission status: Runtime Error

Solution code:
a=input()
if a == A:
  print(T)
elif a == T:
  print(A)
elif a == C:
  print(G)
else:
  print(C)

Submission status: Runtime Error

Solution code:
a=input()
if a==A:
  print(T)
elif a==T:
  print(A)
elif a==C:
  print(G)
else:
  print(C)

Submission status: Runtime Error

Solution code:
a=input()
if a=A:
  print(T)
elif a=T:
  print(A)
elif a=C:
  print(G)
elif a=G:
  print(C)

Submission status: Runtime Error

Solution code:
a=input()
if a=A:
  print(T)
elif a=T:
  print(A)
elif a=C:
  print(G)
else:
  print(C)

Submission status: Runtime Error

Solution code:
dict = {'A':'T','C':'G','T':'A', 'G':'C'}
a = input()
print(dict(a))

Submission status: Runtime Error

Solution code:
def int_raw():
    return int(input())

def ss_raw():
    return input().split()

def ints_raw():
    return list(map(int, ss_raw()))

N = int_raw()
memo = [{} for x in range(N+1)]

dna = ["A","C","G","T"]

def chk(last4):
    for i in range(len(last4)):
        l = list(last4)
        if i > 0:
            l[i],l[i-1] = l[i-1],l[i]
        if "AGC" in "".join(l):
            return False
    return True

def rec(idx, last3):
    if idx == N:
        return 1
    elif last3 in memo[idx]:
        return memo[idx][last3]
    else:
        ret =0
        for d in dna:
            if chk(last3 + d):
                ret+= rec(idx+1,last3[1:]+d)
                ret = ret % (10**9+7)
        memo[idx][last3] = ret
        return ret


def ans():
    return rec(0,"TTT")

print(ans())

Submission status: Runtime Error

Solution code:
b = str(input())
if (b == "A"):
  print("T")
elif (b == "T"):
  print("A")
elif (b == "c"):
  print("G")
elif (b == "G")
  print("C")

Submission status: Runtime Error

Solution code:
b = str(input())
if b == "A":
  pritn("T")
elif b == "T":
  print("A")
elif b == "c":
  print("G")
else:
  print("C")

Submission status: Runtime Error

Solution code:
s = input()
if s == 'A':
    ans = 'T'
elif s== 'T':
    ans = 'A'
elif s == G:
    ans = 'C'
elif s == C:
    ans = 'G'
else:
    print("error")
    
print(ans)

Submission status: Runtime Error

Solution code:

s = input()
if s == 'A':
    print('T')
elif s== 'T':
    print('A')
elif s == G:
    print('C')
else:
    print('G')

Submission status: Runtime Error

Solution code:
s = input()
if s == 'A':
    print('C')
elif s== 'C':
    print('A')
elif s == G:
    print('T')
else:
    print('G')

Submission status: Runtime Error

Solution code:
base = ['A','T','C','G']

ind = base.index(input())
if(ind%2 == 0):
  printf(base[ind+1])
else:
  printf(base[ind-1])

Submission status: Runtime Error

Solution code:
b = input()

if b == 'A':
    print('T')
elif b == 'T':
    print('A')
    
elif B == 'G':
    print('C')
else:
    print('G')

Submission status: Runtime Error

Solution code:
s=input()
if s=="C":
  print("G")
elif s=="G":
  print("C")
elif s=="A":
  print("T"):
else:
  print("A")

Submission status: Runtime Error

Solution code:
if b == "A":
  print("G")
elif b == "G":
  print("A")
elif b == "C":
  print("T")
else:
  print("C")

Submission status: Runtime Error

Solution code:
if b = A:
  print("G")
elif b = G:
  print("A")
elif b = C:
  print("T")
else:
  print("C")

Submission status: Runtime Error

Solution code:
N, Q = list(map(int, input().split()))
S = input()
l = [0] * Q
r = [0] * Q
for x in range(Q):
    l[x], r[x] = list(map(int, input().split()))

isAC = [0] * len(S)
for x in range(len(S) - 1):
    if S[x] == "A" and S[x + 1] == "C":
        isAC[x] = 1

for x in range(Q):
    ans = 0
    cut_isAC = isAC[l[x] - 1:r[x] - 1]
    for y in range(len(cut_isAC)):
        ans += cut_isAC[y]
    print(ans)

Submission status: Runtime Error

Solution code:
print('ATCG'['TAGC'.index()])

Submission status: Runtime Error

Solution code:
b = input()
if b == "A":
  pair = "T"
elif b == "T":
  pair = "A":
elif b == "C":
  pair = "G"
else:
  pair = "C"
print(pair)

Submission status: Runtime Error

Solution code:
i = input()
if i == 'A':
  print('T')
else if i == 'T':
  print('A')
else if i == 'C':
  print('G')
else if i == 'G':
  print('C')

Submission status: Runtime Error

Solution code:
def func():
	i = input()
	if i == 'A':
    	return 'T'
    else if i == 'T':
    	return 'A'
    else if i == 'C':
    	return 'G'
    else if i == 'G':
    	return 'C'

print(func())

Submission status: Runtime Error

Solution code:
c = input()

p = {}
p["A"] = "T"
p["G"] = "C"

print(p[c])

Submission status: Runtime Error

Solution code:
b = raw_input()
if b=="A":
	print("T")
elif b=="T":
	print("A")
elif b=="G":
	print("C")
elif b=="C":
	print("G")

Submission status: Runtime Error

Solution code:
if b=="A":
	print("T")
elif b=="T":
	print("A")
elif b=="G":
	print("C")
elif b=="C":
	print("G")

Submission status: Runtime Error

Solution code:
b = input()
if b=="A":
  print("T")
else if b=="T":
  print("A")
else if b=="G":
  print("C")
else if b=="c":
  print("G")

Submission status: Runtime Error

Solution code:
if b="A":
  return{"T"}
elif b="T":
  return{"A"}
elif b="G":
  return{"C"}
else:
  return{"G"}

Submission status: Runtime Error

Solution code:
N, Q = map(int, input().split())
S = input()
t=[0]*(N+1)
for i in range(N):
	t[i + 1] = t[i] + (1 if S[i : i + 2] == 'AC' else 0)
for i in range(Q):
	l, r = map(int, input().split())
	print(t[r-1] - t[l-1])

Submission status: Runtime Error

Solution code:
N, Q = map(int, input().split())
S = input()
t = [0] * (N+1)
for i in range(N):
    t[i+1] = t[i] + (1 if S[i : i+2] == 'AC' else 0)  
for i in range(Q):
    l, r = map(int, input().split())
    print(t[r-1] - t[l-1])

Submission status: Runtime Error

Solution code:
a = str(input())

if (a == 'A'): 
    print('T')
elif (a == 'T):
    print('A')
elif (a == 'G'):
    print('C')
elif(a =='C'):
    print('G')
else: print("none")

Submission status: Runtime Error

Solution code:
b = input()
X = ['A', 'T']
Y = ['G', 'C']
print(str(X - b) if b in X else str(Y - b))

Submission status: Runtime Error

Solution code:
def how_many_AC(count_summary, str):
  index = str.find('AC')
  if index == -1:
  	return (count_summary, "")
  else:
    return (count_summary+1, str[index+2:])

def how_many_AC_recursive(count1, str1):
  (count2, str2) = how_many_AC(count1, str1)
  if len(str2) <= 1:
    return count2
  else:
    x = how_many_AC_recursive(count2, str2)
    return x

import sys
sys.setrecursionlimit(1000000)
(N, Q) = input().split()
S = input()
for i in range(1, int(Q)+1):
  (l_str, r_str) = input().split()
  l = int(l_str)
  r = int(r_str)
  substr = S[l-1:r]
  out = how_many_AC_recursive(0, substr)
  print(out)

Submission status: Runtime Error

Solution code:
def how_many_AC(count_summary, str):
  index = str.find('AC')
  if index == -1:
  	return (count_summary, "")
  else:
    return (count_summary+1, str[index+2:])

def how_many_AC_recursive(count1, str1):
  (count2, str2) = how_many_AC(count1, str1)
  if len(str2) <= 1:
    return count2
  else:
    x = how_many_AC_recursive(count2, str2)
    return x

import sys
sys.setrecursionlimit(10000000)
(N, Q) = input().split()
S = input()
for i in range(1, int(Q)+1):
  (l_str, r_str) = input().split()
  l = int(l_str)
  r = int(r_str)
  substr = S[l-1:r]
  out = how_many_AC_recursive(0, substr)
  print(out)

Submission status: Runtime Error

Solution code:
def get_answer(s):
    count = 0
    for i, c in enumerate(s):
        if i == len(s) - 1:
            return count
        if c == "A" and s[i + 1] == "C":
            count += 1

    return count

n, q = map(int, input().split())
s = str(input())
questions = []
for _ in range(q):
    a, b = map(int, input().split())
    questions.append((a - 1, b - 1))

for question in questions:
    print(get_answer(s[question[0]: question[1] + 1]))

Submission status: Runtime Error

Solution code:
#-*- coding: utf-8 -*-
"""
oj dl https://atcoder.jp/contests/abc116/tasks/abc116_b -d test-b
oj test -d test-c -c "python abc116c.py"
oj test -d test-b -c "python abc116b.py" test-b/sample-3.in
"""

from collections import defaultdict
import sys
import math
import time
import itertools

#累積和
def deco(func):
    def wrapper(*args, **kwargs):
        s = time.time()
        #print('--start--')
        ret = func(*args, **kwargs)
        logging.debug('--end in %f --' % (time.time() - s) )
        return ret
    return wrapper


@deco
def sol(N, Q, S, LR):
    M = [0] * N
    logging.debug("%s, %s, %s, %s, %s" % (N, Q, S, LR, M))
    for i in range(1, N):
        logging.debug("i:%s" % i)
        if S[i-1] + S[i] == "AC":
            M[i] = M[i-1] + 1
        else:
            M[i] = M[i-1]

    A = [0]*Q
    for j in range(Q):
        l, r = int(LR[j][0])-1, int(LR[j][1])-1
        A[j] = M[r] - M[l]

    return A





import logging

do_submit = False
do_submit = True

if do_submit:
    logging.basicConfig(level=logging.ERROR, format="%(message)s")
else:
    logging.basicConfig(level=logging.DEBUG, format="%(message)s")
def input_parse(input_str):
    lines = [x.strip() for x in input_str.split("\n") if x.strip()]
    parsed_lines = [list(line.split()) for line in lines]
    (N, Q) = parsed_lines[0]
    N = int(N)
    Q = int(Q)
    S = parsed_lines[1][0]
    # return (n, S)
    LR = []
    for i in range(2, 2+Q):
        l , r = int(parsed_lines[i][0]), int(parsed_lines[i][1])
        LR.append((l, r))
    return (N, Q, S, LR)



if not do_submit:
    # n, S= input_parse("""
    # 4
    # 1 2 2 1
    # """)
    (N, Q, S, LR) = input_parse("""
    8 3
    ACACTACG
    3 7
    2 3
    1 8
    """)
    for a in sol(N, Q, S, LR):
        print (a)

    (N, Q, S, LR) = input_parse("""
    20 6
    AGCTAATTTACACGTAATCC
    3 7
    2 3
    1 8
    1 20
    9 18
    14 18
    """)
    for a in sol(N, Q, S, LR):
        print (a)

else:
    str = ""
    NQ = input().strip()
    N, Q= list(map(int, NQ.split()))
    str += NQ + "\n"
    str += input().strip() + "\n"# S
    for i in range(Q):
        str += input().strip() + "\n" # l, r
    (N, Q, S, LR) = input_parse(str)
    #print(sol(N, Q, S, LR))
    for a in sol(N, Q, S, LR):
        print (a)

Submission status: Runtime Error

Solution code:
n,q = (int(i) for i in input().split())
s = input()

for i in range(q):
    l,r = (int(i) for i in input().split())
    cnt =  s.count('AC',l-1,r)
    print(cnt)

Submission status: Runtime Error

Solution code:
i = input()
dict = {"A":"C", "C":"A", "G":"T", "T":"G"}
o = dict[i[b]]
print(o)

Submission status: Runtime Error

Solution code:
dict = {"A":"C", "C":"A", "G":"T", "T":"G"}
print(dict[b])

Submission status: Runtime Error

Solution code:
#-*- coding: utf-8 -*-
"""
oj dl https://atcoder.jp/contests/abc116/tasks/abc116_b -d test-b
oj test -d test-c -c "python abc116c.py"
oj test -d test-b -c "python abc116b.py" test-b/sample-3.in
"""

from collections import defaultdict
import sys
import math
import time
import itertools

#累積和
def deco(func):
    def wrapper(*args, **kwargs):
        s = time.time()
        #print('--start--')
        ret = func(*args, **kwargs)
        logging.debug('--end in %f --' % (time.time() - s) )
        return ret
    return wrapper


#@deco
def sol(N, Q, S, LR):
    M = [0] * N
    logging.debug("%s, %s, %s, %s, %s" % (N, Q, S, LR, M))
    for i in range(1, N):
        logging.debug("i:%s" % i)
        if S[i-1] + S[i] == "AC":
            M[i] = M[i-1] + 1
        else:
            M[i] = M[i-1]

    A = [0]*Q
    for j in range(Q):
        l, r = int(LR[j][0])-1, int(LR[j][1])-1
        A[j] = M[r] - M[l]

    return A





import logging

#do_submit = False
do_submit = True

if do_submit:
    logging.basicConfig(level=logging.ERROR, format="%(message)s")
else:
    logging.basicConfig(level=logging.DEBUG, format="%(message)s")
def input_parse(input_str):
    lines = [x.strip() for x in input_str.split("\n") if x.strip()]
    parsed_lines = [list(map(str, line.split())) for line in lines]
    (N, Q) = parsed_lines[0]
    N = int(N)
    Q = int(Q)
    S = parsed_lines[1][0]
    # return (n, S)
    LR = []
    for i in range(2, 2+Q):
        l , r = int(parsed_lines[i][0]), int(parsed_lines[i][1])
        LR.append((l, r))
    return (N, Q, S, LR)



if not do_submit:
    # n, S= input_parse("""
    # 4
    # 1 2 2 1
    # """)
    (N, Q, S, LR) = input_parse("""
    8 3
    ACACTACG
    3 7
    2 3
    1 8
    """)
    for a in sol(N, Q, S, LR):
        print (a)

    (N, Q, S, LR) = input_parse("""
    8 3
    ACACTACG
    3 7
    2 3
    1 8
    """)
    for a in sol(N, Q, S, LR):
        print (a)

else:
    str = ""
    NQ = input().strip()
    N, Q= list(map(int, NQ.split()))
    str += NQ + "\n"
    str += input().strip() + "\n"# S
    for i in range(Q):
        str += input().strip() + "\n" # l, r
    (N, Q, S, LR) = input_parse(str)
    #print(sol(N, Q, S, LR))
    for a in sol(N, Q, S, LR):
        print (a)

Submission status: Runtime Error

Solution code:
Dict = {'A':'T','C':'G','T':'A','G':'C'}
tmp = input()
print(Dict(tmp))

Submission status: Runtime Error

Solution code:
def get_answer(s):
    count = 0
    for i, c in enumerate(s):
        if i == len(s) - 1:
            return count
        if c == "A" and s[i + 1] == "C":
            count += 1

    return count

n, q = map(int, input().split())
s = str(input())
questions = []
for i in range(q):
    a, b = map(int, input().split())
    questions.append((a - 1, b - 1))

for question in questions:
    print(get_answer(s[question[0]: question[1] + 1]))

Submission status: Runtime Error

Solution code:
a, loop = input().split()
string = input()

for i in range(int(loop)):
  j, k = input().split()
  print(string[int(j)-1:int(k)].count('AC'))

Submission status: Runtime Error

Solution code:
N = int(input())

mod = 10 ** 9 + 7

dp = [[[[0] * 4 for _ in range(4)] for _ in range(4)] for _ in range(N + 1)]

dp[0][3][3][3] = 1

print(dp)
for i in range(N):
    for j in range(4):
        for k in range(4):
            for m in range(4):
                if dp[i][j][k][m] == 0:
                    continue
                for l in range(4):
                    if l == 2 and j == 1 and k == 0:
                        continue
                    if l == 2 and j == 0 and k == 1:
                        continue
                    if l == 1 and j == 2 and k == 0:
                        continue
                    if l == 2 and j == 1 and m == 0:
                        continue
                    if l == 2 and k == 1 and m == 0:
                        continue
                    dp[i + 1][l][j][k] += dp[i][j][k][m]
                    dp[i + 1][l][j][k] %= mod

ans = 0
print(dp)
for i in range(4):
    for j in range(4):
        for k in range(4):
            ans += dp[N][i][j][k]
            ans %= mod
print(ans)

Submission status: Runtime Error

Solution code:
d = {'A': 'C', 'G': 'T', 'C': 'A', 'T': 'G'}
print(d[b])

Submission status: Runtime Error

Solution code:
x=input
if x==A:
  print("T")
elif x==T:
  print("A")
elif x==G:
  print("C")
else:
  print("G")

Submission status: Runtime Error

Solution code:
from sys import (stdin, stout)

CORR_TAB = {
  'A': 'T',
  'T': 'A',
  'G': 'C',
  'C': 'G'',
}

for line in stdin:
  stdout.write(CORR_TAB[line.strip()] + '\n')

Submission status: Runtime Error

Solution code:
b=input()
if b=A:
    print('T')
elif b=T:
    print('A')
elif b=C:
    print('G')
else:
    print('C')

Submission status: Runtime Error

Solution code:
b=input()
if b='A':
    print('T')
elif b='T':
    print('A')
elif b='C':
    print('G')
else:
    print('C')

Submission status: Runtime Error

Solution code:
n, q = map(int, input().split())
s = input()
a = [list(map(int, input().split())) for i in range(q)]

cum=[0]*n
for i in range(1, n):
    cum[i] = cum[i - 1]
    if s[i-1:i+1] == 'AC':
        cum[i]+=1
    print(cum)

for i in range(q):
    print(cum[a[i][1]-1]-cum[a[i][0]-1])

Submission status: Runtime Error

Solution code:
code = input()
if code = 'A':
	print('T')
elif code = 'T':
	print('A')
elif code = 'G':
	print('C')
elif code = 'C':
	print('G')

Submission status: Runtime Error

Solution code:
code = input()
if code = 'A':
	print('T')
elif code = 'T':
    print('A')
elif code = 'G':
    print('C')
elif code = 'C':
    print('G')

Submission status: Runtime Error

Solution code:
code = str(input())
if code = 'A':
	print('T')
elif code = 'T':
    print('A')
elif code = 'G':
    print('C')
elif code = 'C':
    print('G')

Submission status: Runtime Error

Solution code:
b = str(inut())

if b == 'A':
  print('T')
elif b == 'T':
  print('A')
elif b == 'C':
  print('G')
elif b == 'G':
  print('C')

Submission status: Runtime Error

Solution code:
s = input()
if s == 'A':
	print('T')
else if s == 'T':
	print('A')
else if s == 'G':
	print('C')
else if s == 'C':
	print('G')

Submission status: Runtime Error

Solution code:
base = input()

if base == 'A':
  print('T')
elif base == 'T':
  print('A')
elif base =- 'C':
  print('G')
else:
  print('C')

Submission status: Runtime Error

Solution code:
b=input()
b=input()

if b=='A':
  print('T')
elif b=='T':
  print('A')
elif b=='C':
  print('G')
elif b=='G':
  pring('C')

Submission status: Runtime Error

Solution code:
b = input()

if b=='A':
  print "T"
if b=='c':
  print "G"
if b=='G':
  print "C"
if b=='T':
  print "A"

Submission status: Runtime Error

Solution code:
s=input()

if s=='A':
	print 'T'
elif s=='T':
  	print 'A'
elif s=='G':
 	print 'C'
elif s=='C':
	print 'G'

Submission status: Runtime Error

Solution code:
input1 = input().split()
N = input1[0]
Q = input1[1]
S = input()

flag = 0
count = 0
result = []

for q in range(int(Q)):
	
	input3 = input().split()
	
	l = int(input3[0])
	r = int(input3[1])+1
	
	for s in (range(l,r)):
		
		#print(s)
		if S[s-1] == 'A':
			flag += 1
			
		elif ((S[s-1] == 'C') and (flag == 1)):
			count += 1
			flag = 0
			
		else:
			flag = 0
			
	result.append(count)
	
	count = 0
	flag = 0
	
for i in result:
	print(i)

Submission status: Runtime Error

Solution code:
N,Q = map(int, input().split())
S = input()
t = [0] * (N+1)

for i in range(N):
    t[i+1] = t[i] + (1 if S[i:i+2] == 'AC' else 0)

for i in range(Q):
    l,r = map(int, input().split())
    print(t[r-1] - t[l-1])

Submission status: Runtime Error

Solution code:
l1 = ['A','T']
l2 = ['C','G']
b = str(input())
print(b)
ans = ''
if b in l1:
    l1.remove(b)
    ans = t1[0]
if b in l2:
    l2.remove(b)
    ans = l2[0]
print(ans)