Harryxun/stf_run huggingface dataset:
while True:
    hit = 0
    blow = 0
    a = input().split(' ')
    b = input().split(' ')
    for a_, b_ in zip(a, b):
        if a_ == b_:
            hit += 1
        elif a_ in b:
            blow += 1
    print(hit, blow)



### FIXED CODE ###

import sys

a = []
for line in sys.stdin:
    a.append(line.strip())
ita = iter(a)

for a, b in zip(ita, ita):
    hit = 0
    blow = 0
    a = a.split(' ')
    b = b.split(' ')
    for a_, b_ in zip(a, b):
        if a_ == b_:
            hit += 1
        elif a_ in b:
            blow += 1
    print(hit, blow)
n,x=map(int,input().split())
L = list(map(int,input().split()))
count=0
D=0
for i in range(n+1):
    if D<=x:
        D=D+L[i]     
        count+=1
    else:
        print(count)
        break

### FIXED CODE ###

n,x=map(int,input().split())
L = list(map(int,input().split()))
count=1
D=0
for i in L:
    D=D+i
    if D<=x:
        count+=1
    else:
        break
 
print(count)
import sys

sys.setrecursionlimit(10**6)

a,b,c = map(int, input().split())
k = int(input())

m = [[] for _ in range(7)]
m[0].append([a,b,c])

for i in range(k):
    for j in m[i]:
        m[i+1].append([j[0]*2, j[1],j[2]])
        m[i+1].append([j[0], j[1]* 2, j[2]])
        m[i+1].append([j[0], j[1], j[2]* 2])

ans = 'No'
for t in m[k]:
    if t[0] < t[1] and t[1]<t[2]:
        ans = 'Yes'
        break
    else:
        continue
print(ans)

### FIXED CODE ###

import sys

sys.setrecursionlimit(10**6)

a,b,c = map(int, input().split())
k = int(input())

m = [[] for _ in range(8)]
m[0].append([a,b,c])

for i in range(k):
    for j in m[i]:
        m[i+1].append([j[0]*2, j[1],j[2]])
        m[i+1].append([j[0], j[1]* 2, j[2]])
        m[i+1].append([j[0], j[1], j[2]* 2])

ans = 'No'

for t in m[k]:
    if t[0] < t[1] and t[1] < t[2]:
        ans = 'Yes'
        break
print(ans)
N, *p = map(int, open(0).read().split())
p.sort()
print(p[:-1].sum() + p[-1]/2)

### FIXED CODE ###

N = int(input())
p = [int(input()) for i in range(N)]
p.sort()
print(int(sum(p[:-1]) + p[-1]/2))
= int(input())
A = [0]*N

for i in range(N):
    A[i] = int(input())

mx = max(A)
mxi = A.index(max(A))

for i in range(N):
    
    if i != mxi:
        print(mx)
    elif i == 0:
        print(max(A[1:N]))
    elif i == N-1:
        print(max(A[mxi+1:N]))
    else:
        print(max(max(A[0:i]),max(A[i+1:N])))


### FIXED CODE ###

N = int(input())
A = [0]*N

for i in range(N):
    A[i] = int(input())

mx = max(A)
mxi = A.index(max(A))

for i in range(N):
    if i != mxi:
        print(mx)
    elif i == 0:
        print(max(A[1:N]))
    elif i == N-1:
        print(max(A[0:N-1]))
    else:
        print(max(max(A[0:i]),max(A[i+1:N])))
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = []
for i in range(1,int(sqrt(N))):
  if N%i == 0:
    A.append(i + N//i -2)
    
print(min(A))      

### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = []
for i in range(1, int(sqrt(N))+1 ):
  if N%i == 0:
    A.append(i + N//i -2)

print(min(A))
a,b = map(int,input().split())

print((a*(b*100))//100)

### FIXED CODE ###

from math import floor
from fractions import Fraction
a, b = input().split()
a = int(a)
b = Fraction(b)
print(floor(a * b))
import sys
k=1000
N=int(input())
L=list(map(int,input().split()))
i=0
while i<N-1:
  if L[i]<L[i+1]:
    n=L[i]
    break
  i+=1
  if i==N-1:
    print(1000)
    sys.exit()
n=0
for j in range(i,N):
  if j==N-1 and n!=0:
    m=max(L[s:])
    c=k%n
    k=((k//n)*m)+c
    n=0
    break
  if L[j]<L[j+1] and n==0:
    n=L[j]
    s=j
  if L[j]>L[j+1] and n!=0:
    m=L[j]
    c=k%n
    k=((k//n)*m)+c
    n=0
print(k)

### FIXED CODE ###

import sys
k=1000
N=int(input())
L=list(map(int,input().split()))
i=0
while i<N-1:
  if L[i]<L[i+1]:
    n=L[i]
    break
  i+=1
  if i==N-1:
    print(1000)
    sys.exit()
n=0
for j in range(i,N):
  if j==N-1 and n!=0:
    m=max(L[s:])
    c=k%n
    k=((k//n)*m)+c
    n=0
    break
  if j==N-1 and n==0:
    break
  if L[j]<L[j+1] and n==0:
    n=L[j]
    s=j
  if L[j]>L[j+1] and n!=0:
    m=L[j]
    c=k%n
    k=((k//n)*m)+c
    n=0
print(k)
import sys
sys.setrecursionlimit(10000000)

N=int(input())

A=[int(i) for i in input().split()]


c=[0,0,0]
ans=1

for i in range(N):
    s=sum([c[j]==A[i] for j in range(0,3)])
    c[c.index(A[i])]+=1
    ans=(ans*s)%1000000007

print(ans%1000000007)

### FIXED CODE ###


N=int(input())

A=[int(i) for i in input().split()]


c=[0,0,0]
ans=1
uncho=True

for i in range(N):
    s=sum([c[j]==A[i] for j in range(0,3)])
    if s==0:
        uncho=False
        print(0)
        break
    c[c.index(A[i])]+=1
    ans=(ans*s)%1000000007

if uncho:
    print(ans%1000000007)
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if V<=W:
    print("NO")
    import sys
    sys.exit()

# import math
# if abs(B-A)/(V-W) <= T:
#     print("YES")
# else:
#     print("NO")

# print("t=",t)
# print("A+Vt=", A+V*t)
# print("B+Wt=", B+W*t)

if A+V*t >= B+W*t:
    if 1 <= t and t <= T:
        print("YES")
    else:
        print("NO")
else:
    print("NO")

### FIXED CODE ###

A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if V<=W:
    print("NO")
    import sys
    sys.exit()
import math
if abs(B-A)/(V-W) <= T:
    print("YES")
else:
    print("NO")
import sys
l=[t for t in sys.stdin]
i=0
while 1:
    pt=[i.find("1") for i in l[9*i:9*(i+1)] if i.find("1")!=-1]
    if not pt:break
    if len(pt)==1:print("C")
    elif len(pt)==2 and pt[0]==pt[1]:print("A")
    elif len(pt)==2 and pt[0]<pt[1]:print("E")
    elif len(pt)==2 and pr[0]>pt[1]:print("G")
    elif len(pt)==3 and pt[0]>pt[1]:print("D")
    elif len(pt)==3 and pt[0]<pt[1]:print("F")
    else: print("B")
    i+=1



### FIXED CODE ###

t=[{(0,1),(1,0),(1,1)},
   {(1,0),(2,0),(3,0)},
   {(0,1),(0,2),(0,3)},
   {(1,-1),(1,0),(2,-1)},
   {(0,1),(1,1),(1,2)},
   {(1,0),(1,1),(2,1)},
   {(0,1),(1,-1),(1,0)}
]

while 1:
    l=[input() for _ in range(8)]
    pos=sorted([(i,j) for i in range(8) for j in range(8) if l[i][j]=="1"])
    cv=lambda v:tuple([v[0]-pos[0][0],v[1]-pos[0][1]])
    pt=set(map(cv,pos))
    [print(chr(65+i)) for (i,j) in enumerate(t) if pt&j==j]
    try:
        input()
    except:
        break
import sys
h,w,a,b = map(int,input().split())
tempa = 0
tempb = [0]*w

list_tb = [[0 for i in range(w)] for j in range(h)]
if w % a != 0 or h % b != 0:
  print("No")
  sys.exit()

if h > 2:
  for i in range(h):
    tempa = 0
    for j in range(w):
      if tempa < a and tempb[j] < b:
        list_tb[i][j] = 1
        tempa += 1
        tempb[j] += 1
else:
  for j in range(w):
    if tempa < a:
      list_tb[0][j] = 1
      tempa += 1

for i in list_tb:
    print(*i,sep="")

### FIXED CODE ###

h,w,a,b  = map(int,input().split())
lst_a  = [[1]*a + [0] * (w-a) for i in range(b)]
lst_b  = [[0]*a + [1] * (w-a)] * (h-b)
for i in lst_a:
 print(*i,sep="")
for i in lst_b:
 print(*i,sep="")
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
from queue import PriorityQueue
from fractions import gcd
inf, eps, mod = 10 ** 20, 1.0 / 10**10, 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def _pf(s): return print(s, flush=True)
def _cumsum(l): return list(itertools.accumulate(l))

"""
なかのものと端のもの
両端が一緒かどうか
一緒なら、K-1個変える
中を変える/2切り下げ
まず、端が一緒か
"""
S = input()
K = _I()
ans = 0

if len(S) == 1:
    print(math.floor(K//2))
    exit()
#  if len(S) == 2:
#      if S[0] == S[1]:
#          print(K)
#      else:
#          print(0)
#      exit()

if S[0] == S[-1]:
    if S[-1] == S[-2]:
        if S[-2] != S[-3]:
            ans += 1
    S = S[:-1] + '?'
    ans += K - 1
    # 端は上で変えられた
else:
    pass

# 端変えないので、中だけ
previous = 'HOGE'
for s in S:
    if s == previous:
        ans += K
        previous = 'HOGE'
    else:
        previous = s
print(ans)


### FIXED CODE ###

import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools, pdb
sys.setrecursionlimit(10**7)
from queue import PriorityQueue
from fractions import gcd
inf, eps, mod = 10 ** 20, 1.0 / 10**10, 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def _pf(s): return print(s, flush=True)
def _cumsum(l): return list(itertools.accumulate(l)) 
"""
なかのものと端のもの
両端が一緒かどうか
一緒なら、K-1個変える
中を変える/2切り下げ
まず、端が一緒か
"""
S = input()
K = _I()
ans = 0

if len(set(S)) == 1:
    print(int(math.floor(len(S)*K/2)))
    exit()

S2 = S*2
S3 = S*3

torn_list_1 = []
previous = 'hoge'
for s in S2:
    if s == previous:
        torn_list_1[-1] += 1
    else:
        torn_list_1.append(1)
        previous = s
torn_list_2 = []
previous = 'hoge'
for s in S3:
    if s == previous:
        torn_list_2[-1] += 1
    else:
        torn_list_2.append(1)
        previous = s

ans2 = 0
ans3 = 0
for t in torn_list_1:
    if t>=2:
        ans2+=int(math.floor(t/2))

for t in torn_list_2:
    if t>=2:
        ans3+=int(math.floor(t/2))

diff = ans3-ans2

ans = ans2 + (K-2)*diff
print(ans)
n, r = int(input().split())

if n>=10:
  inner_rate = r
else:
  inner_rate = r + 100*(10-n)
  
print(str(inner_rate))

### FIXED CODE ###

n, r = map(int, input().split())
 
if n>=10:
  inner_rate = r
else:
  inner_rate = r + 100*(10-n)
  
print(str(inner_rate))
N,K=map(int,input().split())
S = list(input())

S[K-1] = S[K-1].lower()

print("".join(S)

### FIXED CODE ###

N,K=map(int,input().split())
S = list(input())

S[K-1] = S[K-1].lower()

print("".join(S))
n,m=map(int,input().split())
A = list(map(int,input().split()))
B=[]
for i in range(m):
    B.append(list(map(int,input().split())))

B.sort(key=lambda B: B[1], reverse=True)
A.sort()

i=j=0
ans = sum(A)
while j<n:
    newv = B[i][1]
    newc = B[i][0]
    if newv>A[j+newc-1] :
        ans+=newv*newc-sum(A[j:j+newc])
        i+=1
        j+=newc
    elif newv>A[j] :
        for k in range(newc):
            if newv<=A[j+k]:
                ans+=newv*k-sum(A[j:j+k])
                i+=1
                j+=k
                break
    else:
        break
    if i>=m :
        break

print(ans)

### FIXED CODE ###

n,m=map(int,input().split())
A = list(map(int,input().split()))
B=[]
for i in range(m):
    B.append(list(map(int,input().split())))
A.sort()
B.sort(key=lambda B: B[1], reverse=True)

i=j=0
ans = sum(A)
while j<n:
    newv = B[i][1]
    newc = min(B[i][0],n-j)
    if newv>A[j] :
        for k in range(newc):
            if newv<=A[j+k]:
                break
        else:
            k+=1
        ans+=newv*(k)-sum(A[j:j+k])
        i+=1
        j+=k
    else:
        break
    if i>=m :
        break

print(ans)
import numpy as np
while True:
    num = int(input())
    if num == 0: break
    array = np.array(list(map(float, input().split())))
    print(np.std(array))

### FIXED CODE ###

import math
while True:
    num = int(input())
    if num == 0: break
    array = [int(i) for i in input().split()]
    mean = sum(array) / num
    a = 0
    for i in range(num):
        a += (array[i] - mean) ** 2
    a /= num
    a = math.sqrt(a)
    print(a)
n, q = map(int, input().split())

class Node:
    def __init__(self, root):
        self.root = root
        self.children = []
        self.val = 0

    def add_child(self, child_node):
        self.children.append(child_node)
        if self.root is not None:
            self.root.add_child(child_node)

nodes = [None] * n
nodes[0] = Node(None)

for i in range(1, n):
    a, b = map(int, input().split())
    a_node = nodes[a - 1]
    if nodes[b - 1] is None:
        b_node = Node(a_node)
        nodes[b - 1] = b_node
    a_node.add_child(nodes[b - 1])

for j in range(q):
    p, x = map(int, input().split())
    node = nodes[p - 1]
    node.val += x
    children = node.children
    for child in children:
        child.val += x

res = []
for node in nodes:
    res.append(str(node.val))
print(" ".join(res))

### FIXED CODE ###

n, q = map(int, input().split())

children_map = [None] * n
vals = [0] * n

for i in range(1, n):
    a, b = map(int, input().split())
    children_map[b - 1] = a - 1

for j in range(q):
    p, x = map(int, input().split())
    vals[p - 1] += x

res = []
for i in range(n):
    parent = children_map[i]
    if parent is not None:
        vals[i] += vals[parent]
    res.append(str(vals[i]))

print(" ".join(res))
#include <bits/stdc++.h>
using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);

  map<string, int> cnt;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    cnt[s]++;
  }
  int m;
  cin >> m;
  for (int i = 0; i < m; i++) {
    string t;
    cin >> t;
    cnt[t]--;
  }
  int res = 0;
  for (auto &sc : cnt) {
    res = max(res, sc.second);
  }
  cout << res << '\n';
  return 0;

}

### FIXED CODE ###

#                         author:  kagemeka 
#                         created: 2019-11-06 22:04:18(JST)
import sys
import collections
# import math
# import string
# import bisect
# import re
# import itertools
# import statistics
# import functools
# import operator

def main():
    l = sys.stdin.read().split()
    n = int(l[0])
    m = int(l[n+1])
    a = collections.Counter(l[1:n+1])
    b = collections.Counter(l[n+2:n+m+2])
    for s, c in b.items():
        if s in a:
            a[s] -= c

    ma = max(max(a.values()), 0)
    print(ma)
        

if __name__ == "__main__":
    # execute only if run as a script
    main()
height, width = map(int, input().split(" "))
grids = list()
grids_accessed = list()
whites = 0
for h in range(height):
    inputted = input()
    whites += inputted.count(".")
    grids.append(list(inputted))
    grids_accessed.append([False]*len(inputted))


def get_next(x, y):
    nexts = ((x-1, y),
             (x+1, y),
             (x, y-1),
             (x, y+1))
    for x, y in nexts:
        if (0 <= x <= width-1) and (0 <= y <= height-1):
            if grids[y][x] == ".":
                yield x, y


def dfs():
    queue = list()
    x, y = 0, 0
    queue.append((x, y))
    while True:
        x, y = queue.pop(0)
        if x == width-1 and y == height-1:
            return
        for n_x, n_y in get_next(x, y):
            if grids_accessed[n_y][n_x] is False:
                grids_accessed[n_y][n_x] = (x, y)
                queue.append((n_x, n_y))


def get_shortest():
    x, y = width-1, height-1
    distance_traveled = 0
    while True:
        if x == 0 and y == 0:
            return distance_traveled
        else:
            x, y = grids_accessed[y][x]
            distance_traveled += 1


dfs()
d = get_shortest() + 1
score = whites - d
if score < 0:
    score = -1
print(score)


### FIXED CODE ###

height, width = map(int, input().split(" "))
grids = list()
grids_accessed = list()
whites = 0
for h in range(height):
    inputted = input()
    whites += inputted.count(".")
    grids.append(list(inputted))
    grids_accessed.append([False]*len(inputted))


def get_next(x, y):
    nexts = ((x-1, y),
             (x+1, y),
             (x, y-1),
             (x, y+1))
    for x, y in nexts:
        if (0 <= x <= width-1) and (0 <= y <= height-1):
            if grids[y][x] == ".":
                yield x, y


def dfs():
    queue = list()
    x, y = 0, 0
    queue.append((x, y))
    while True:
        try:
            x, y = queue.pop(0)
        except IndexError:
            return
        if x == width-1 and y == height-1:
            return
        for n_x, n_y in get_next(x, y):
            if grids_accessed[n_y][n_x] is False:
                grids_accessed[n_y][n_x] = (x, y)
                queue.append((n_x, n_y))


def get_shortest():
    x, y = width-1, height-1
    distance_traveled = 0
    while True:
        if x == 0 and y == 0:
            return distance_traveled
        else:
            x, y = grids_accessed[y][x]
            distance_traveled += 1


dfs()
if grids_accessed[height-1][width-1] is False:
    print(-1)
else:
    d = get_shortest() + 1
    score = whites - d
    if score < 0:
        score = -1
    print(score)
s=input()
l = []
l.append(s[0])
c = 0
for i in range(1, n):
  if s[i] == l[i-1]:
    c += 1
    l.append(str(abs(int(s[i])-1)))
  else:
    l.append(s[i])
print(c)


### FIXED CODE ###

s=input()
l = []
l.append(s[0])
c = 0
for i in range(1, len(s)):
  if s[i] == l[i-1]:
    c += 1
    l.append(str(-(int(s[i])-1)))
  else:
    l.append(s[i])
print(c)
c1=input()
c2=input()
if c1[0]==c2[2] and c1[1]==c2[2] adn c1[2]==c2[0]:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

c1=input()
c2=input()
if c1[0]==c2[2] and c1[1]==c2[1] and c1[2]==c2[0]:
  print('YES')
else:
  print('NO')
n = int(input())
Bs = list(map(int,input().split()))
ans = 0

if n==2:
    ans = Bs[0]*2

elif n==3:
    ans += sum(Bs)
    ans += min(Bs)

else:
    ans += Bs[0]
    ans += Bs[-1]
    for i in range(n-2,-1,-1):
        ans += min(Bs[i],Bs[i+1])
        
print(ans)

### FIXED CODE ###

n = int(input())
Bs = list(map(int,input().split()))
ans = 0

if n==2:
    ans = Bs[0]*2

elif n==3:
    ans += sum(Bs)
    ans += min(Bs)
else:
    ans += Bs[0]
    ans += Bs[-1]
    for i in range(len(Bs)-1):
        ans += min(Bs[i],Bs[i+1])
        
print(ans)
import itertools

h,w,k = map(int, input().split())
c = [list(input()) for _ in range(h)]
r = []
s = 0
ans = 0
for i in c:
  s += i.count('#')
if s==k:
  print(1)
  quit()
for i in range(w):
  row = []
  for j in range(h):
    if c[j][i]=='#' and 
    row.append(c[j][i])
  r.append(row)
re = c + r
for i in range(1,len(re)):
  combs = itertools.combinations(re, i)
  for j in list(combs):
    if (s-sum(j))==k:
      ans += 1
print(ans)

### FIXED CODE ###

h,w,k = map(int, input().split())
c = [list(input()) for _ in range(h)]
ans = 0
for pattern_h in range(2**h):
  for pattern_w in range(2**w):
    count = 0
    for i in range(h):
      for j in range(w):
        if (pattern_h>>i)&1==0 and (pattern_w>>j)&1==0:
          if c[i][j]=='#':
            count += 1
    if count == k:
      ans += 1
print(ans)
N = int(input())
A = [int(_) for _ in input().split()]
T = []

for i in range(N):
    flag = 0
    for j in range(len(T)):
        if A[i] == T[j][0]:
            T[j][1] += 1
            flag = 1
            break
    if flag == 0:
        T.append([A[i],1])
T2 = []
for i in range(len(T)):
    T2.append(T[i][1])

def hoge(List):
    ans = 0
    for i in range(len(List)):
        ans += (List[i]-1)*List[i]//2
    return ans

for i in range(N):
    for j in range(len(T)):
        if T[j][0] == A[i]:
            T2[j] -= 1
            print(hoge(T2))
            T2[j] += 1
            break

### FIXED CODE ###

N, M = map(int,input().split())

print(int((N*(N-1)/2)+(M*(M-1)/2)))
from itertools import accumulate

n, q = map(int, input().split())

s = input()

problems = [list(map(int, input().split())) for _ in range(q)]


def count(total, i):
    return total + 1 if s[i-1] + s[i] == 'AC' else total


cumsum = [0, *accumulate(range(1, n), count)]

for l, r in problems:
    print(cumsum[r-1] - cumsum[l-1])

### FIXED CODE ###

from itertools import accumulate

n, q = map(int, input().split())

s = input()

problems = [list(map(int, input().split())) for _ in range(q)]


def count(total, i):
    return total + 1 if s[i:i+2] == 'AC' else total


cumsum = list(accumulate([0] + list(range(n)), count))

for l, r in problems:
    print(cumsum[r-1] - cumsum[l-1])
def comb(n, r):
  if r == 0  or n == r: return 1
  else: return comb(n-1, r) + comb(n-1, r-1)

k, s = map(int, input().split())
print(comb(s-3k+2, 2))

### FIXED CODE ###

ans = 0
k, s = map(int, input().split())
for x in range(k+1):
  for y in range(k+1):
    z = s - x - y
    if 0 <= z and z <= k:
      ans += 1
 
 
 
print(ans)
N = int(input())
a = list(map(int, input().split()))
a.reverse()

def search(x):
    n = 1
    res = 0
    while True:
        nx = n*x
        if nx > N:
            break
        res += boxes[nx-1]
        n += 1
    return res%2


boxes = [0]*N
for i, ai in enumerate(a):
    i = N-i
    eo = search(i)
    if ai!=eo:
        boxes[i]=1

ans=[]
for i, box in enumerate(boxes):
    if box==1:
        ans.append(i)

if ans==[]:
    print(0)
else:
    print(*ans)

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))

M = 0
boxes = [0]*N
for i in reversed(range(N)):
    num_balls = 0
    for k in range(i, N, i+1):
        num_balls += boxes[k]
    if num_balls%2 != a[i]:
        boxes[i] = 1
        M += 1

print(M)
for i in range(N):
    if boxes[i]==1:
        print(i+1)
if S[0:(len(S))] == T[0:(len(S))]:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

S = input()
T = input()

if S[0:(len(S))] == T[0:(len(S))]:
    print("Yes")
else:
    print("No")
a,b = map(int(),input().split())
c = a*b
d = c%2
if d==1:
  print("Odd")
else:
  print("Even")

### FIXED CODE ###

a,b = map(int,input().split())
c = a*b
d = c%2
if d==1:
  print("Odd")
else:
  print("Even")