Harryxun/stf_run huggingface dataset:
import sys
import numpy as np
input = sys.stdin.readline
N = int(input())
ans = [111,222,333,444,555,666,777,888,999]
for i in ans:
    if ans >= N:
        print(ans)
        sys.exit()

### FIXED CODE ###

import sys
import numpy as np
input = sys.stdin.readline
N = int(input())
ans = [111,222,333,444,555,666,777,888,999]
for i in ans:
    if i >= N:
        print(i)
        sys.exit()
def temp(val):
    [a,b]=val.split()
    a = int(a)
    b = int(b)
    print("{} {}".format(a*b, 2*a+2*b))

temp(input)

### FIXED CODE ###

def temp(val):
    [a,b]=val.split()
    a = int(a)
    b = int(b)
    print("{} {}".format(a*b, 2*a+2*b))

temp(input())
if __name__ == '__main__':
    x = int(input())
    y = int(input())
    z = int(input())
    t = (x, y, z)

    a = max(t)
    b, c =  [_ for _ in t if _ != a]
    print(((a - (a // 2)) * b * c) - ((a // 2) * b * c))


### FIXED CODE ###

if __name__ == '__main__':
    x, y, z = (int(_) for _ in input().split(' '))
    a = max((x, y, z))
    if a == x:
        b, c = y, z
    elif a == y:
        b, c = x, z
    elif a == z:
        b, c = x, y
    print(abs(a // 2 * b * c - (a - a // 2) * b * c))
import numpy as np

N, K = map(int, input().split())
hs = np.array(list(map(int, input().split())))

i = 0
total_cost = 0
 
a = np.zeros(N, int)
a[0] = 0
a[1] = abs(hs[1] - hs[0])

for i in range(2, N):
    a[i] = float('inf')
    for j in range(max(i-K,0),i):
        a[i] = min(a[i], a[j] + abs(hs[i] - hs[j]))    
print(a[-1])


### FIXED CODE ###

import numpy as np

N, K = map(int, input().split())
hs = np.array(list(map(int, input().split())))

i = 0
total_cost = 0
 
a = np.zeros(N, dtype=np.int64)
a[0] = 0
a[1] = abs(hs[1] - hs[0])

for i in range(2, N):
    k = min(K,i)
    a[i] = np.min(a[i-k:i] + np.abs(hs[i] - hs[i-k:i]))    
print(a[-1])
A, B, C = map(int,input().split())

if A == B == C:
    print(No)
    
else:
    print(Yes)

### FIXED CODE ###

a = set(map(int, input().split()))
if len(a) == 2:
  print("Yes")
else:
  print("No")
s = input()
sa = int(s[:2])
sb = int(s[3:])

if sa >= 1 and sa <= 12 and sb >= 1 and  sb <= 12:
    print('AMBIGUOUS')
    exit()
else
    if sa >= 1 and sa <= 12:
        print('MMYY')
        exit()
    if sb >= 1 and sb <= 12:
        print('YYMM')
        exit()

print('NA')

### FIXED CODE ###


s = input()
sa = int(s[:2])
sb = int(s[2:])

if sa >= 1 and sa <= 12 and sb >= 1 and  sb <= 12:
    print('AMBIGUOUS')
    exit()
else:
    if sa >= 1 and sa <= 12:
        print('MMYY')
        exit()
    if sb >= 1 and sb <= 12:
        print('YYMM')
        exit()

print('NA')
N = int(input())
ab = []
cd = []
for i in range(N):
    a,b = map(int,input().split())
    ab.append([0,a,b])
for i in range(N):
    c,d = map(int,input().split())
    cd.append([0,c,d])

cover = []
for i in range(N):
    cnt = 0
    cov = []
    for j in range(N):
        if ab[j][1] < cd[i][1] and ab[j][2] < cd[i][2]:
            cnt += 1
            cov.append(j)
    cd[i][0] = cnt
    cover.append(cov)

cover.sort()
cd.sort()
cd_dist = []
for i in range(N):
    dist = []
    if cd[i][0] != 0:
        for j in cover[i]:
            d = (ab[j][1]-cd[i][1])**2+(ab[j][2]-cd[i][2])**2
            dist.append([d,j])
        dist.sort()
        cd_dist.append(dist)
    else:
        cd_dist.append([])

flag = [1]*N
ans = 0
for i in range(N):
    for j in range(cd[i][0]):
        if flag[cd_dist[i][j][1]]:
            ans += 1
            flag[cd_dist[i][j][1]] = 0
            break

print(ans)

### FIXED CODE ###

##実装のバグがとれぬ　答えを見る

N = int(input())
ab = []
cd = []
for i in range(N):
    a,b = map(int,input().split())
    ab.append([b,a,i])
for i in range(N):
    c,d = map(int,input().split())
    cd.append([c,d,i])

ab.sort()
cd.sort()

ans = 0
flag_ab = [1]*N
for i in range(N):
    pos = -1
    for j in range(N):
        if ab[j][0] < cd[i][1] and ab[j][1] < cd[i][0] and flag_ab[j]:
            pos = max(pos,j)
    if pos != -1:
        flag_ab[pos] = 0
        ans += 1

print(ans)
R, G = map(int, input().split())

print(2 * G - R)

### FIXED CODE ###

R = int(input())
G = int(input())

print(2 * G - R)
import numpy as np
import sys

def main()
buf = sys.stdin.buffer
R,C = map(int,buf.readline().split())
# \nが含まれるから列要素の数が+1
black = (np.frombuffer(buf.read(R*(C+1)),dtype='S1') == b'#')
sharps = np.where(black==True)[0]

coord_x = np.array([[j for i in range(C)] for j in range(R)])
coord_y = np.array([[i for i in range(C)] for j in range(R)])

sharps = sharps[sharps%(C+1)!=C]

sharps_x = sharps//(C+1)
sharps_y = sharps%(C+1)
for i,(one_sharp_x,one_sharp_y) in enumerate(zip(sharps_x,sharps_y)):
    #one_sharp_x = one//(C+1)
    #one_sharp_y = one%(C+1)
    if i == 0:
        result_np = abs(coord_x-one_sharp_x) + abs(coord_y-one_sharp_y)
    else:
        result_np = np.minimum(result_np,abs(coord_x-one_sharp_x) + abs(coord_y-one_sharp_y))

print(max(result_np.flatten()))

if __name__ == '__main__':
    main()


### FIXED CODE ###

import numpy as np
import sys
# https://atcoder.jp/contests/agc033/submissions/6021787
buf = sys.stdin.buffer
H,W = map(int,buf.readline().split())
# +1周分だけ
black = np.zeros((H+2,W+2),dtype=np.bool)
# \nがあることに注意
black[1:-1,1:] = (np.frombuffer(buf.read(H*(W+1)),dtype='S1') == b'#').reshape(H,W+1)

INF = 10 ** 4
dist = np.zeros((H,W),dtype=np.int16)
# .のところは０それ以外はINFで初期化
dist[~black[1:-1,1:-1]] = INF
# 右、左、下、上と展開させていく感じ
for n in range(1,H):
    np.minimum(dist[n-1]+1,dist[n],out=dist[n])
for n in range(H-2,-1,-1):
    np.minimum(dist[n+1]+1,dist[n],out=dist[n])
for n in range(1,W):
    np.minimum(dist[:,n-1]+1,dist[:,n],out=dist[:,n])
for n in range(W-2,-1,-1):
    np.minimum(dist[:,n+1]+1,dist[:,n],out=dist[:,n])

print(dist.max())
n, MOD = int(input()), 10 ** 9 + 7

memo = [{} for _ in range(n+1)]
def ok(last4):
    for i in range(4):
        t = list(last4)
        if i >= 1:
            t[i], t[i-1] = t[i-1], t[i]
        if "".join(t).count("AGC") != 0:
            return False
    return True

def dfs(cur, last3):
    if last3 in memo[cur]:
        return memo[cur][last3]
    if cur == N:
        return 1
    ret = 0
    for c in "AGCT":
        if ok(last3) + c:
            ret = (ret + dfs(cur+1, last3[1:] + c)) % MOD
    memo[cur][last3] = ret
    return ret

print(dfs(0,"TTT"))

### FIXED CODE ###

n, MOD = int(input()), 10 ** 9 + 7

memo = [{} for _ in range(n+1)]
def ok(last4):
    for i in range(4):
        t = list(last4)
        if i >= 1:
            t[i], t[i-1] = t[i-1], t[i]
        if "".join(t).count("AGC") != 0:
            return False
    return True

def dfs(cur, last3):
    if last3 in memo[cur]:
        return memo[cur][last3]
    if cur == n:
        return 1
    ret = 0
    for c in "AGCT":
        if ok(last3 + c):
            ret = (ret + dfs(cur+1, last3[1:] + c)) % MOD
    memo[cur][last3] = ret
    return ret

print(dfs(0,"TTT"))
import math

def lcm(a, b):
	return a * b // math.gcd(a, b)

n = int(input())
t = [int(input()) for i in range(n)]

t += [1]
a = t.pop()
while t:
	b = t.pop()
	a = lcm(a, b)
print(a)

### FIXED CODE ###

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

def lcm(a, b):
	return a * b // gcd(a, b)

n = int(input())
t = [int(input()) for i in range(n)]

ans = t[0]
for t_i in t[1:]:
	ans = lcm(ans, t_i)

print(ans)
N,K = map(str, input().split())
S = int(input())


#n番目の文字を指定されたら n-1番目が真の指定

number = (K-1)

if S[number] == "A":
    S[number] = "a"
elif S[number] == "B":
    S[number] = "b"
elif S[number] == "C":
    S[number] = "c"     

print("".join(s))

### FIXED CODE ###

n, k = map(int,input().split())
s = list(input())
 
if s[k-1] == "A":
  s[k-1] = "a"
elif s[k-1] == "B":
  s[k-1] = "b"
elif s[k-1] == "C":
  s[k-1] = "c"
 
print("".join(s))
n = int(input().rstrip())
seconds = [int(input().rstrip()) for _ in range(n)]
seconds = set(seconds)

def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)
def lcm(a,b):
    g = gcd(a,b)
    if a > b:
        return int(a/g*b)
    else:
        return int(a*b/g)
ans = 1
for num in seconds:
    ans = lcm(ans,num)
print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
n = int(input().rstrip())
seconds = [int(input().rstrip()) for _ in range(n)]
#seconds = list(set(seconds))

def gcd(a,b):
    if int(b) == 0:
        return int(a)
    return gcd((b),(a%b))
def lcm(a,b):
    g = gcd(a,b)
    if a<b:
        return int(a/g)*b
    else:
        return int(b/g)*a

ans = 1
for num in seconds:
    ans = int(lcm(ans,num))
print(ans)
n, k = map(int , input().split())
h = list(map(int, input().split()))
count = 0
h.sort()
del h[-k]
for i in range(len(h)):
    count += h[i]
print(count)


### FIXED CODE ###

n, k = map(int , input().split())
h = list(map(int, input().split()))
count = 0
MOD = 1000000007
h.sort()
try:
    if(k != 0):
        del h[-k]
    for i in range(n - k):
        count += h[i]%MOD
    print(count)
except IndexError:
    count = 0
    print(count)
#Colorful Leaderboard
import numpy as np
import math as m
n = int(input())
a = np.array(list(map(int, input().split())))
b = sorted (a//400)
cnt = 0
for i in range(len(b)):s
    if b[i]  < 8:
        None
    else:
        b[i]+=i
        cnt+=1
c = len(list(set(b)))

print(str(c-cnt) + " " + str(c))

### FIXED CODE ###

#Colorful Leaderboard
import numpy as np
n = int(input())
a = np.array(list(map(int, input().split())))
b = sorted (a//400)
cnt = 0
for i in range(len(b)):
    if b[i]  < 8:
        None
    else:
        b[i]+=i
        cnt+=1
c = len(list(set(b)))

print(str(max([1,c-cnt])) + " " + str(c))
time=int(input())
sec=time%60
min=(time/60)%60
hour=time/3600
print(hour \: min \: sec)

### FIXED CODE ###

time=int(input())
sec=time%60
min=(time//60)%60
hour=time//3600
print(hour,min,sec,sep=':')
import math
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
 
n, m = input().split(" ")
 
print(comb(n, 2) + comb(m, 2))

### FIXED CODE ###

import math

def comb(n, r):
    try: 
        return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
    except:
        return 0

raw = input()
n, m = [int(i) for i in raw.split(" ")]
 
print(comb(n, 2) + comb(m, 2))
h,w = map(int,input().split())
a = [""]*h
for i in range(h):
  a[i] = input()

row = [False]*h
column = [False]*w

for i in range(h):
  for j in range(w):
    if a[i][j] = "#":
      row[i] = True
      column[j] = True

for i in range(h):
  if row[i]:
    for j in range(w):
      if column[j]:
        print("a[i][j]",end = "")
    print()
        
    
      


### FIXED CODE ###

h,w = map(int,input().split())
a = [""]*h
for i in range(h):
  a[i] = input()

row = [False]*h
column = [False]*w

for i in range(h):
  for j in range(w):
    if a[i][j] == "#":
      row[i] = True
      column[j] = True

for i in range(h):
  if row[i]:
    for j in range(w):
      if column[j]:
        print(a[i][j],end = "")
    print()
N,C=map(int,input().split())
D=[list(map(int,input().split())) for i in range(C)]
A=[list(map(int,input().split())) for i in range(N)]
X=[[0]*C for i in range(3)]
for c in range(C):
  for i in range(N):
    for j in range(N):
      X[(i+j)%3][c]+=D[A[i][j]][c]
P=10**20
for i in range(C):
  for j in range(C):
    for k in range(C):
      if len(set([i,j,k]))==3:
        P=min(P,X[0][i]+X[1][j]+X[2][k])
print(P)

### FIXED CODE ###

N,C=map(int,input().split())
D=[list(map(int,input().split())) for i in range(C)]
A=[list(map(int,input().split())) for i in range(N)]
X=[[0]*C for i in range(3)]
for c in range(C):
  for i in range(N):
    for j in range(N):
      X[(i+j)%3][c]+=D[A[i][j]-1][c]
P=10**20
for i in range(C):
  for j in range(C):
    for k in range(C):
      if len(set([i,j,k]))==3:
        P=min(P,X[0][i]+X[1][j]+X[2][k])
print(P)
_, X = map(int, input().split())
A = sorted(list(map(int, input().split())))

count = 0
for a in A:
    if a > X:
        break
    X -= a
    count += 1

if X > 0:
    count -= 1

print(count)

### FIXED CODE ###

_, X = map(int, input().split())
A = sorted(list(map(int, input().split())))

count = 0
for a in A:
    if X - a >= 0:
        X -= a
        count += 1

if count == len(A) and X > 0:
    count -= 1

print(count)
import math
a, b = input().split())
c = int(a+ b)
 
if math.sqrt(c).is_integer() == True:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

import math
a, b = map(str,input().split())
c = int(a+ b)
 
if   math.sqrt(c).is_integer() == True:
    print('Yes')
else:
    print('No')
1 s = input()
2 print('x' * len(s))

### FIXED CODE ###

s = input()
print("x" * len(s))
import math
from collections import deque
from collections import defaultdict
import itertools as it

#自作関数群
def readInt():


### FIXED CODE ###

import math
from collections import deque
from collections import defaultdict

import time

#自作関数群
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def combmod(n,r,mod):
	return (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod
def printQueue(q):
	r=copyQueue(q)
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): # root
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): # much time
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} # 1~n
def bitArr(n):#ビット全探索
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1
def maxValue(a,b,v):
	v2 = v
	for i in range(v2,-1,-1):
		for j in range(v2//a+1): #j:aの個数
			k = i-a*j
			if k%b==0:
				return i
	return -1
def copyQueue(q):
	nq = queue.Queue()
	n = q.qsize()
	for i in range(n):
		x = q.get()
		q.put(x)
		nq.put(x)
	return nq

a,b = readInts()

print(a*b)
S=raw_input()
f=False
for i in range(len(S)-1):
    if S[i]==S[i+1]:f=True
if f:
    print("Bad")
else:
    print("Good")    


### FIXED CODE ###

S=raw_input()
f=False
for i in range(len(S)-1):
    if S[i]==S[i+1]:f=True
if f:
    print("Bad")
else:
    print("Good")
n=int(input())
ans = []
for i in range(1,n**0.5+1):
  if n%i==0:
    j=n//i
    ans.append(len(str(i))+len(str(j)))
print(max(ans))

### FIXED CODE ###

n=int(input())
ans = []
for i in range(1,int(n**0.5+1)):
  if n%i==0:
    j=n//i
    ans.append(max(len(str(i)),len(str(j))))
print(min(ans))
s = input()
n = len(s)
t = input()
m = len(t)

if n < m:
    print("UNRESTORABLE")
    exit()
p = False
for i in reversed(range(n-m+1)):
    flag = True
    for j in range(m):
        if s[i+j] != "?" and s[i+j] != t[j]:
            flag = False
            break
    if flag:
        s = s[:i] + t
        p = True
        break

if not p:
    print("UNRESTORABLE")
    exit()
elif p:
    for i in range(n):
        if s[i] == "?":
            s = s[:i] + "a" + s[i+1:]
print(s)

### FIXED CODE ###

s = input()
t = input()

a = len(s)
b = len(t)
ans = []
if a-b+1 < 0:
    print("UNRESTORABLE")
    exit()

for i in range(a-b+1):
    p = 0
    for j in range(b):
        if s[i+j] != t[j] and s[i+j] != "?":
            p = 1
            break
    if p == 0:
        kar = s[:i] + t + s[i+b:]
        kar = kar.replace("?","a")
        ans.append(kar)
if len(ans) == 0:
    print("UNRESTORABLE")
else:
    ans.sort()
    print(ans[0])
N,M,K = map(int,input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))


def Cum(X):
    temp = 0
    Cum = [0]*len(X)
    for i in range(len(X)):
        temp += X[i]
        Cum[i] += temp
    return Cum

a = Cum(A)
a = a.insert(0,0)
b = Cum(B)
b = b.insert(0,0)


def f(X,x,target):
    return X[x]-target

def nibutan(X):
    num = list(range(len(X)))
    lo = 0
    hi = len(X)
    while hi-lo>=2:
        mid = (lo+hi)//2
        if f(X,mid,Y)<=0:
            lo = mid
        else:
            hi = mid
    return lo

ans = 0
for i in range(N):
    if K-a[i]>=0:
        Y = K-a[i]
        ans = max(nibutan(b)+i,ans)
    else:
        break
print(ans)

### FIXED CODE ###

N,M,K = map(int,input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))


def Cum(X):
    temp = 0
    Cum = [0]*len(X)
    for i in range(len(X)):
        temp += X[i]
        Cum[i] += temp
    return Cum

a = Cum(A)
a.insert(0,0)
b = Cum(B)
b.insert(0,0)

na = 0
for i in range(N+1):
    if i == N and a[i]<=K:
        na = N
    elif a[i]<=K and a[i+1]>K:
        na = i

ans = na

nb = 0
for i in range(na,-1,-1):
    temp = K-a[i]
    for j in range(nb,M+1):
        if j == M and b[j] <= temp:
            nb = M
            ans = max(ans,i+nb)
        elif b[j]<=temp and b[j+1]>temp:
            nb = j
            ans = max(ans,i+nb)
            break
        
print(ans)
#%%
import time



import numpy as np

N = int(input())
A = [0] * N
B = [0] * N
C = [[] for _ in range(N) ]
takahashi = 0
aoki = 0
for i in range(N):
  A[i], B[i] = map(int,input().split())
  C[i].append(i)
  C[i].append((np.array(A)[1] + np.array(B)[1]))



C = sorted(C, key=lambda x:x[1])




while len(C) > 0:
  tmp_max = C[-1][0]
  takahashi += A[tmp_max]
  A.pop(tmp_max)
  B.pop(tmp_max)
  C.pop(tmp_max)

  if len(C)>0 :
    tmp_max = C[-1][0]
    aoki += B[tmp_max]
    A.pop(tmp_max)
    B.pop(tmp_max)
    C.pop(tmp_max)

print(takahashi-aoki)






### FIXED CODE ###

#%%
import time

import numpy as np

N = int(input())
A = [0] * N
B = [0] * N
C = [[] for _ in range(N) ]
takahashi = []
aoki = []

start = time.time()

for i in range(N):
  A[i], B[i] = map(int,input().split())


D = np.array(A) + np.array(B)
for i in range(N):
  C[i] = [i, D[i]]


elapsed_time = time.time() - start
#print ("elapsed_time:{0}".format(elapsed_time) + "[sec]")
start = time.time()

C = sorted(C, key=lambda x:x[1])


elapsed_time = time.time() - start
#print ("elapsed_time:{0}".format(elapsed_time) + "[sec]")
start = time.time()


if N %2 == 0 :
  for i in range(1,N,2):
    tmp_max = C[-i][0]
    takahashi.append(A[tmp_max])
    tmp_max = C[-i-1][0]
    aoki.append(B[tmp_max])

elif N %2 != 0 :
  for i in range(1,N-1,2):
    tmp_max = C[-i][0]
    takahashi.append(A[tmp_max])
    tmp_max = C[-i-1][0]
    aoki.append(B[tmp_max])
  tmp_max = C[-N][0]
  takahashi.append(A[tmp_max])

print(sum(takahashi)-sum(aoki))

elapsed_time = time.time() - start
#print ("elapsed_time:{0}".format(elapsed_time) + "[sec]")
from collections import defaultdict

n, m = map(int, input().split())
ps = []
for _ in range(n):
  ps.append(map(int, input().split()))

sub_st = defaultdict(list)
for p, s in ps:
  sub_st[p].append(s)

solved = 0
error = 0
for k, v in sub_st.items():
  temp_error = 0
  for history in v:
    temp_error += 1
    if 'AC' in v:
      error += temp_error
      solved += 1
      break

priny(solved, error)
    

### FIXED CODE ###

from collections import defaultdict

n, m = map(int, input().split())
ps = []
for _ in range(m):
    ps.append(input().split())

sub_st = defaultdict(list)
for p, s in ps:
    sub_st[p].append(s)

solved = 0
error = 0
for k, v in sub_st.items():
    temp_error = 0
    for history in v:
        if 'AC' in history:
            error += temp_error
            solved += 1
            break
        temp_error += 1

print(solved, error)
x = map(int, input().split())
print(2*x*3.14)

### FIXED CODE ###

x = int(input())
print(2*x*3.14)
import heapq
N, M = map(int, input().split())
A = map(int, input().split())
A = [-x for x in A]
heapq.heapify(A)
for _ in xrange(M):
    cur = -(-heapq.heappop(A) // 2)
    heapq.heappush(A, cur)
print(-sum(A))

### FIXED CODE ###

import heapq

N, M = map(int, input().split())
A = [-i for i in map(int, input().split())]
heapq.heapify(A)
for i in range(M):
  tmp = -((-heapq.heappop(A))//2)
  heapq.heappush(A, tmp)

print(-sum(A))
n = int(input())
count = 0
for i in range(n):
  if len(i+1)%2 == 1:
    count += 1

print(count)

### FIXED CODE ###

n = int(input())
count = 0
for i in range(n):
  if len(str(i+1))%2 == 1:
    count += 1
 
print(count)
d1,d2 = [],[]
n = int(input())
for i in range(n):
    a,b=input().split()
    d1.append(a)
    d2.append(b)
for i in n-2:
  if d1[i] == d2[i] and d1[i+1] == d2[i+1] and d1[i+2] == d2[i+2]:
	print("Yes")
  return 0

print("No")


### FIXED CODE ###

ans = "No"
count = 0
n = int(input())
for i in range(n):
  a,b=map(int,input().split())
  if a == b:
    count += 1
    if count >= 3:
        ans ="Yes"
  else:
    count = 0

print(ans)
x,y = map(int, input().split())
if x==2 or y==2:
  print("No")
  exit()

if x==4 or x==6 or x==9 or x==11:
  if y==4 or y==6 or y==9 or y~=11:
    print("Yes")
  else:
    print("No")
else:
	print("No")
  

### FIXED CODE ###

x,y = map(int, input().split())
if x==2 or y==2:
  print("No")
  exit()

if x==4 or x==6 or x==9 or x==11:
  if y==4 or y==6 or y==9 or y==11:
    print("Yes")
  else:
    print("No")
else:
    print("Yes")
a = input()
b???= input()
print(int(a) * int(b))
print((int(a) * 2) + (int(b) * 2))

### FIXED CODE ###

a ,b = input().split(' ')
print(int(a) * int(b),(int(a) * 2) + (int(b) * 2))
N = int(input())
L = list(map(int,inptu().split()))

count = 0
for i in range(len(L)):
    for j in range(len(L)):
        for k in range(len(L)):
            if L[i] + L[j] > L[k] and L[j] + L[k] > L[i] and L[i] + L[k] > L[j] and i != j and j != k and i != k:
                count += 1
print(count)

### FIXED CODE ###

N = int(input())
L = list(map(int,input().split()))
L.sort()
count = 0
for i in range(len(L)):
    for j in range(i+1,len(L)):
        for k in range(j+1,len(L)):
            if L[i] + L[j] > L[k] and L[j] + L[k] > L[i] and L[i] + L[k] > L[j] and L[i] != L[j] and L[j] != L[k] and L[i] != L[k]:
                count += 1
print(count)
N = int(input())
A = map(int,input())
if 0 in A:
  print(sum(A))
else:
  count=0
  min_A =100000000000000000
  for i in range(N):
    if A[i]<0:
      count=count+1
    if abs(A[i])<min_A:
      min_A = abs(A[i])
  print(sum(A)-min_A)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
if 0 in A:
  A = list(map(abs,A))
  print(sum(A))
else:
  count=0
  min_A =100000000000000000
  for i in range(N):
    if A[i]<0:
      count=count+1
    if abs(A[i])<min_A:
      min_A = abs(A[i])
  A = list(map(abs,A))
  if count%2==0:
    print(sum(A))
  else:
    print(sum(A)-min_A*2)
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

D = abs(A-B)
E = abs(V - W)
time = float(D/E)
if D == 0:
  print("YES")
elif E <= 0:
	print("NO")
else:
	if time <= T:
		print("YES")
	else:
		print("NO")

### FIXED CODE ###

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

D = float(abs(A-B))
E = float(V - W)

if E <= 0:
	print("NO")
	exit()
time = D/E
if time <= T:
	print("YES")
else:
	print("NO")
N, X = map(int, input().split())
L = map(int, input().split())

D = 0
count = 1

for l in L:
    D += l

    if D <= X:
        count += 1

    else:
        breakXh

print(count)


### FIXED CODE ###

N, X = map(int, input().split())
L = map(int, input().split())

D = 0
count = 1

for l in L:
    D += l

    if D <= X:
        count += 1

    else:
        break

print(count)