peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
n, h = map(int, input().split())
ab = []
for i in range(n):
  a, b = map(int, input().split())
  ab.append((-a, b, i))
  
ab.sort()
index = ab[0][2]

ab2 = ab[:]
ab2.sort(key = lambda x:x[1], reverse = True)

cnt = 0

for a, b ,i in ab2:
  if h <= 0:
    print(cnt)
    sys.exit()
  a = -a
  if i == index:
    print(1+cnt+ max(0, h - b + a - 1) // a)
    sys.exit()
  else:
    h -= b
    cnt += 1
# Judge status: Accepted
#ABC 130B
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = 0
cnt = 1
for i in l:
   d += i
   if d <= x:
      cnt += 1
print(cnt)
# Judge status: Accepted
n=int(input())
mod=10**9+7
a=list(map(int,input().split()))
ans=0
for i in range(60):
    ichi=0
    for j in range(n):
        if (a[j]>>i)&1:
            ichi+=1
    zero=n-ichi
    s=ichi*zero*pow(2,i,mod)%mod# xorをしたあとi桁目が1になる組み合わせの個数 x 2**i
    ans+=s
    ans%=mod
print(ans)
# Judge status: Wrong Answer
N= int(input())
flag = False
for i in range(1,10):
	for j in range(1,10):
		A=i*j
		if(A==N):
			flag=True
			break
	if flag: break
if flag:print("Yes")
else:print("No")
# Judge status: Wrong Answer
import math
def main():
    x = int(input())
    if(x>6):
        res = 1
    if(x%11<=6):
        a = math.ceil((x+5)/11)
        b = a-1
        print(a+b)
    else:
        a=math.ceil((x)/11)
        b=a
        print(a+a)
if __name__ == '__main__':
    main()
# Judge status: Accepted

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

H = list(map(int, input().split()))

S = [True]*N

for _ in range(M):
  a, b = map(int, input().split())
  if H[a-1] == H[b-1]:
    S[b-1] = False
    S[a-1] = False
  elif H[a-1] > H[b-1]:
    S[b-1] = False
  else:
    S[a-1] = False

print(sum(S))
# Judge status: Accepted
N,M = map(int,input().split())
A = list(map(int,input().split()))

total = 0
for i in A:
    if i >= (sum(A) / (4 * M)):
        total = total + 1

if total >= M:
    print("Yes")
else:
    print('No')
# Judge status: Wrong Answer
import fractions
from functools import reduce

mod = 10**9 + 7

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y) % mod

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

n = int(input())
a = list(map(int, input().split()))
a_ = []
for i in range(n):
    a_.append(pow(a[i], mod - 2, mod))

num_lcm = lcm(*a) % mod
ans = 0
for i in range(n):
    ans = (ans + num_lcm * a_[i] % mod) % mod

print(ans)
# Judge status: Accepted
s =list(input())
t=list(input())
ans=[]
for i in range(len(s)-len(t)+1):
    check=0
    s_check=s[i:i+len(t)]
    for k in range(len(s_check)):
        if s_check[k]==t[k]:
            check+=1
    ans.append(check)
print(len(t)-max(ans))
# Judge status: Accepted
S = input()
maxi = max(S.count("a"), S.count("b"), S.count("c"))
mini = min(S.count("a"), S.count("b"), S.count("c"))
mid = len(S)-maxi-mini
if maxi == mid and mid == mini:
    print("YES")
elif maxi == mid + 1 and mid == mini:
    print("YES")
elif maxi == mid and mid == mini + 1:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
n = int(input())

cnt = 0
flg = 0

for i in range(n):
    a, b = map(int, input().split())

    if a == b:
        cnt += 1
        if cnt >= 3:
            flg = 1
    else:
        cnt = 0

    print(cnt)
    print(flg)

if flg == 1:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
s = input()
t = input()
s_long = len(s)
t_long = len(t)
ok = []
for i in range(s_long - t_long+1):
  part_s = s[i:i+t_long]
  check = True
  for j in range(t_long):
    if part_s[j] != "?" and part_s[j] != t[j]:
      check = False
  if check == True:
    ok.append(i)
  
if len(ok) == 0:
  print("UNRESTORABLE")
else:
  a = max(ok)
  s = s[:a] + t + s[a + t_long + 1:]
  s = list(s)
  for i in range(len(s)):
    if s[i] == "?":
      s[i] = "a"
  print("".join(s))
# Judge status: Accepted
A, B = map(int, input().split())
S = input()
for i in range(A+B+1):
    if S[A] == '-':
        if S[:A].isdecimal() == True and S[A+1:].isdecimal() == True:
            print('Yes')
            break
else:
    print('No')
# Judge status: Wrong Answer
import math
R = int(input())
ans = R*R*math.pi
print(ans)
# Judge status: Accepted
s = input()
n = len(s)
a1 = [0] * (n+1) # 左側に連続する<の個数
a2 = [0] * (n+1) # 右側に連続する>の個数
tmp1 = 0
tmp2 = 0
for i in range(n):
    if s[i] == "<": tmp1 += 1
    else: tmp1 = 0
    if s[n-i-1] == ">": tmp2 += 1
    else: tmp2 = 0
    a1[i+1] = tmp1
    a2[n-i-1] = tmp2
ans = 0
for i in range(n+1):
    ans += max(a1[i], a2[i])
print(ans)
# Judge status: Accepted
n, m = map(int, input().split())
n, m = min(n, m), max(n, m)
if n == 1:
  if m == 1:
    print(1)
  else:
    print(m - 2)
else:
  print((n - 2) * (m - 2))
# Judge status: Accepted
n,k,*a=map(int,open(0).read().split())
d=[2*k]*n
s=0
while k:s=a[s]-1;d[s]=k=~-k%(d[s]+1-k)
print(s+1)
# Judge status: Accepted
X, K, D = map(int, input().split())

X = abs(X)
a = int(X/D)
ans = 0

if a>=K:
    ans = X-(D*K)
else:
    if K%2==0:
        if a%2==0: ans = X-(D*a)
        else: ans = X-(D*a)-D
    else:
        if a%2==0: ans = X-(D*a)-D
        else: ans = X-(D*a)

ans = int(abs(ans))
print(ans)
# Judge status: Wrong Answer
p = list(map(int, input().split()))
if sum(p) >= 22:
    print('bust')
else:
    print('Win')
# Judge status: Wrong Answer
n,l=map(int,input().split())
r=l+n-1
m=r if r<0 else l
s=(l+r)*n//2
print(s if l*r<0 else s-m)
# Judge status: Accepted
from math import sqrt
N = int(input())
pts = []
for i in range(N):
    x,y = map(int,input().split())
    pts.append((x,y))
def fact(n):
    if n == 1:
        return 1
    return fact(n-1)*n
ans = 0
for i in range(N):
    for j in range(N):
        x1,y1 = pts[i]
        x2,y2 = pts[j]
        dx = x1-x2
        dy = y1-y2
        ans += fact(N-1)*(sqrt(dx**2+dy**2))
print(ans/fact(N))
# Judge status: Accepted
n=int(input())
a = list(map(int, input().split()))
q=int(input())
bc = [list(map(int, input().split())) for i in range(q)]
memo=[0]*100001
ans=0
for i in range(n):
    ans+=a[i]
    memo[a[i]-1]+=1
for i in range(q):
    memo[bc[i][1]-1]+=memo[bc[i][0]-1]
    ans+=memo[bc[i][0]-1]*(bc[i][1]-bc[i][0])
    memo[bc[i][0]-1]=0
    print(ans)
# Judge status: Wrong Answer
import math
x,y = map(int,input().split())
n = math.floor(math.log2(y)-math.log2(x))+1
print(n)
# Judge status: Accepted
N, M = map(int, input().split())
if N == 1 and M == 1:
    print(1)
elif N == 1 and M != 1:
    print(M - 2)
elif M == 1 and N != 1:
    print(N - 2)
else:
    print((N - 2) * (M - 2))
# Judge status: Accepted
import sys
c = [list(map(int, input().split())) for _ in range(3)]

# a1 = 0と仮定
b = []
a = [0]
for i in range(3):
    b.append(c[0][i])

for i in range(3):
    if i == 0:
        continue
    else:
        a.append(c[i][i] - b[i])

for i in range(3):
    for j in range(3):
        if c[i][j] != a[i] + b[j]:
            print("No")
            sys.exit()
print("Yes")
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
e=a-b|b-c
print(len(f'{e&-e:b}')-(e==b&1))
# Judge status: Accepted
import sys
sys.setrecursionlimit(10**9)

N = int(input())

def bfs(s, cnt, m):
	if cnt == N:
		print(s)
		return

	for i in range(97,ord(m)+2):
		if chr(i) > m:
			bfs(s+chr(i), cnt+1, chr(i))
		else:
			bfs(s+chr(i), cnt+1, m)

bfs('a',1,'a')
# Judge status: Accepted
# 最高で進んでもtを超えることはできない
# 1ターンにつき1進むので偶奇をみる

n = int(input())
pre = [0, 0, 0]  # time, x, y
for i in range(n):
    t, x, y = map(int, input().split())
    t -= pre[0]
    x -= pre[1]
    y -= pre[2]
    if t < abs(x) + abs(y) or (abs(x) + abs(y)) % 2 != t % 2:
        print("No")
        exit()
    pre = [t, x, y]
print("Yes")
# Judge status: Accepted
s=[input() for i in range(3)]
l=[len(s[i]) for i in range(3)]
abc=[0,0,0]
now=0
while abc[now]!=l[now]:
    s_sub=s[now][abc[now]]
    abc[now]+=1
    now=(0 if s_sub=="a" else 1 if s_sub=="b" else 2)
print("A" if now==0 else "B" if now==1 else "C")
# Judge status: Accepted
def main():
    H = int(input())
    W = int(input())
    N = int(input())

    ans = 0
    h, w = 0, 0
    while True:

        if H >= W and h != H:
            N -= H
            h += 1
        elif w != W:
            N -= W
            w += 1
            
        ans += 1

        if N <= 0:
            print(ans)
            exit()
if __name__ == '__main__':
    main()
# Judge status: Accepted
n,x,t=map(int,input().split())

tt=((n-1)//x+1)*t
print(tt)
# Judge status: Accepted
n,k=map(int,input().split())

d={}
for _ in range(n):
    a_i,b_i=map(int,input().split())
    if a_i in d:
        d[a_i]+=b_i
    else:
        d[a_i]=b_i


a=[]
b=[]

d=sorted(d.items(),key=lambda x: x[0])


prev=0
for key,value in d:
    a.append(key)
    b.append(prev+value)

    prev+=value


for j in range(len(b)):
    if k<=b[j]:
        break

print(a[j])
# Judge status: Accepted
K = int(input())
S = input()
if len(S) <= K:
    print(S)
else:
    print(S[:K] + "...")
# Judge status: Accepted
n=int(input())
result= sum(list(map(int, str(n))))
if result % 9==0:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
S = list(input())
S[3] = "8"
print(S)
# Judge status: Wrong Answer
from collections import Counter

n = int(input())
s = str(input())
d = Counter(s)
S = list(set(s))
ans = 1
for t in S:
    ans *= d[t] + 1
print(ans - 1)
# Judge status: Accepted
a = list(map(int,input().split()))
k = int(input())
a.sort(reverse = True)
a[0] = a[0] * (2 ** k)
print(sum(a))
# Judge status: Accepted
n=int(input())
st=set()
for _ in range(n):
    st.add(input())
print(len(st))
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
ma = [0] * (100000 + 1)

for i in range(N):
    ma[A[i]] += 1

Q = int(input())

s = sum(A)

for i in range(Q):
    b, c = map(int, input().split())
    diff = c * ma[b] - ma[b] * b
    ma[c] += ma[b]
    ma[b] = 0
    s += diff
    print(s)
# Judge status: Wrong Answer
import sys,math,copy,queue,itertools,bisect,collections
sys.setrecursionlimit(10**7)
LI = lambda : [int(x) for x in sys.stdin.readline().split()]
_LI = lambda : [int(x)-1 for x in sys.stdin.readline().split()]
NI = lambda : int(sys.stdin.readline())
INF = 10**18
MOD = 10**9 + 7
DD = ((1,0),(0,1),(-1,0),(0,-1))

S,W = LI()
if S > W * 2:
    print ('safe')
else:
    print ('unsafe')
# Judge status: Accepted
h=int(input())
d=1
ans=0
while h:
  ans+=d
  h//=2
  d*=2
print(ans)
# Judge status: Accepted
def main():
    A, B = map(int, input().split())
    if A == B:
        print('Draw')
    elif A == 1 and B <= 13:
        print('Alice')
    elif B == 1 and A <= 13:
        print('Bob')
    elif A > B:
        print('Alice')
    elif B > A:
        print('Bob')
main()
# Judge status: Wrong Answer
w = input()
w_dict = {}
for char in w:
    if char in w_dict:
        w_dict[char] += 1
    else:
        w_dict[char] = 1

if all(elem%2 == 0 for elem in w_dict.values()):
    print('YES')
else:
    print('NO')
# Judge status: Accepted
n=int(input())
a= [int(input()) for i in range(n)] 

a.sort()
ans=0
m=1

for i in range(1,n):
    if a[i-1] == a[i]:
        m+=1
    else:
        ans+=(m%2)
        m=1

ans+=(m%2)

print(ans)
# Judge status: Accepted
A, B = map(int, input().split())
for i in range(20):
    if (A*i-(i-1) >= B ):
        print(i)
        exit(0)
# Judge status: Accepted
n, y = map(int, input().split())

def search():
    for i in range(n+1):
        for j in range(n-i+1):
            k = (n - i - j)
            if i * 10000 + j * 5000 + 1000 * k == y:
                return i, j, k
    return -1, -1, -1
print(*search())
# Judge status: Accepted
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
 
a, b = [0], [0]
for i in range(N):
	a.append(a[i]+A[i])
for i in range(M):
	b.append(b[i]+B[i])
	
ans, j = 0, M
for i in range(N+1):
	if a[i] > K:
		break
	while b[j] > K - a[i]:
		j -= 1
	ans = max(ans, i+j)
	
print(ans)
# Judge status: Accepted
n,m = map(int, input().split())
p = [0]*n
q = [False]*n
for _ in range(m):
  v,s = input().split()
  v = int(v)-1
  if q[v]: continue
  if s == 'AC': q[v] = True
  else: p[v] += 1
print(sum(q),sum(p[i] for i in range(n) if q[i]))
# Judge status: Wrong Answer
A, B = map(int, input().split())
 
if B%(A-1) == 1:
  print((B-1)//(A-1) )
elif B == 0:
  print(0)
else:
  print(B//A +1)
# Judge status: Wrong Answer
K,S = map(int,input().split())

z = 0
o = 0
t = 0

for i in reversed(range(K+1)):
  if i < (S-1)//3 + 1:
    break
  else:
    num = min(S-i,i)-(S-i+1)//2 + 1
    z += num
    if (S-i) % 2 == 0:
      z -= 1
      o += 1
    if min(S-i,i) == i:
      z -= 1
      o += 1
if S % 3 == 0:
  t += 1
  o -= 1
#print(z,o,t)
print(z*6 + o*3 + t)
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
n = int(input())
A = list(map(int,input().split()))
B = [0] * (n+1)
for i in range(n):
    B[A[i]] += 1

C = [0] * (n+1)
for i in range(n):
    C[i] = B[i]*(B[i]-1)//2

su = sum(C)

for i in range(n):
    print(su - C[A[i]] + (B[A[i]]-1)*(B[A[i]]-2)//2)
# Judge status: Accepted
# vim: fileencoding=utf-8


def main():
    red, green, blue = map(int, input().split())
    k = int(input())
    res = "No"
    for i in range(k):
        if blue <= green or blue <= red:
            blue *= 2
        elif green <= red:
            green *= 2
        if blue > green and green > red:
            res = "Yes"
            break
    print(res)


if __name__ == "__main__":
    main()
# Judge status: Accepted
N,M=map(int,input().split())

ans=min(N,M//2)
M-=ans*2
M=max(M,0)
ans+=M//4
print(ans)
# Judge status: Accepted
s=input()
t=set(s)
t=list(t)
if len(t)!=2:
  print("No")
  exit(0)
c1,c2=0,0
for ss in s:
  if t[0]==ss:c1+=1
  if t[1]==ss:c2+=1

if c1==2 and c2==2:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
V = [0]*(N+1)
flug = 0
Lsum= sum(A)

V[0] = 1
for i in range(N):
    V[i+1] = (V[i]*2 - A[i+1])
    if V[i] <= 0:
        flug = 1
    Lsum = Lsum - A[i+1]
    if V[i+1] > Lsum :
        V[i+1] = Lsum
V[N]=0
 
ans = sum(V)+sum(A)
if A[0] != 0:
    ans = -1
if flug == 1:
   ans = -1
if N == 0:
    ans = -1

print(ans)
# Judge status: Wrong Answer
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))

n,a,b,c,d = iim()
s = input()[:d]

if '##' in s:
    print('No')
elif c < d:
    print('Yes')
else:
    print('Yes' if '...' in s else ' No')
# Judge status: Accepted
A, B = map(int, input().split())

ans = 0
for i in range(A, B + 1):
    str_i = str(i)
    if str_i[0] == str_i[-1] and str_i[1] == str_i[-2]:
        ans += 1

print(ans)
# Judge status: Wrong Answer
N, M, K = map(int, input().split())
for i in range(M):
    for j in range(N):
        area = i * j + (N - i) * (M - j)
        if area == K:
            print('Yes')
            exit()
print("No")
# Judge status: Accepted
n,x=map(int,input().split())
a=list(map(int,input().split()))
sm=0
for i in range(n-1):
  b=max(a[i]+a[i+1]-x,0)
  a[i+1]=max(a[i+1]-b,0)
  sm+=b
 
print(sm)
# Judge status: Accepted
N=int(input())
for i in range(1,10**5):
  if (i*(i+1))//2>=N:
    print(i)
    exit()
# Judge status: Wrong Answer
n = int(input())
T = [int(input()) for _ in range(n)]

from fractions import gcd
from functools import reduce

print(reduce(gcd,T))
# Judge status: Wrong Answer
n, a, b = map(int, input().split())

if (b - a) % 2 == 0:
  print(int(b - (a+b)/2))
else:
  if (a - 1) >= (n - b):
    print("a")
    print((n-b) + 1 + int(n - (n+a+(n-b)+1)/2))
  else:
    print((a-1) + 1 + int(b-(a-1)-1 - (b-(a-1)-1 + 1)/2))
# Judge status: Accepted
S = str(input())
T = str(input())
count = 0
for i in range(len(S)):
    if(S[i]!=T[i]):
        count = count+1
print(count)
# Judge status: Wrong Answer
S = input()
num = ""
l = len(S)
dis = float("inf") 

for i in range(l-2):
    num = S[i:i+3]
    if abs(787-int(num)) < dis:
        dis = abs(753-int(num))
        
for i in range(l-3):
    num = S[i:i+4]
    if abs(787-int(num)) < dis:
        dis = abs(753-int(num))

print(dis)
# Judge status: Wrong Answer
N = int(input())
n = (N+1)//2
print(n)
print(n/N)
# Judge status: Accepted
s = int(input())
MOD = 10**9
x = (-s) % MOD
y = (s+x)//MOD
print(0, 0, 10**9, 1, x, y)
# Judge status: Wrong Answer
s = input()
n = len(s)
flg=True
for i in range(n-1):
    if(s[i] == s[i+1]):
        print("no")
        flg=False
        break

if flg:
    print("yes")
# Judge status: Wrong Answer
import sys
import os
import math


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    A, B = list(map(int, sys.stdin.readline().split()))
    print(math.ceil(B/A))


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
a,b,c,d=map(int,input().split())

for i in range(100):
  if i%2==0:
    c-=b
  else:
    a-=d
  if a<=0:
    print("No")
    break
  if c<=0:
    print("Yes")
    break
# Judge status: Accepted
W, H, N=map(int, input().split())
hen=[0,W,0,H]
for _ in range(N):
  x, y, a=map(int, input().split())
  if a==1:
    hen[a-1]=max(hen[a-1], x)
  elif a==2:
    hen[a-1]=min(hen[a-1], x)
  elif a==3:
    hen[a-1]=max(hen[a-1], y)
  elif a==4:
    hen[a-1]=min(hen[a-1], y)
yoko=hen[1]-hen[0]
tate=hen[3]-hen[2]
if yoko<0 or tate<0:
  ans=0
else:
  ans=yoko*tate
print(ans)
# Judge status: Accepted
a,b=map(int,input().split())
if a<=9 and b<=9:
  print(a*b)
else:
  print(-1)
# Judge status: Wrong Answer
n = int(input())
p = list(map(int, input().split()))

ans = set()
for i in range(1, n-1):
	a = []
	a.append(p[i-1])
	a.append(p[i])
	a.append(p[i+1])
	a.sort()
	if a[0] < a[1] and a[1] < a[2]:
	  ans.add(a[1])
	
print(len(ans))
# Judge status: Wrong Answer
N, X = map(int, input().split())
L = map(int, input().split())
D = 0
ans = 0

for l in L:
    if D > X:
        break
    D = D + l
    ans += 1

print(ans)
# Judge status: Wrong Answer
n = int(input())
A = [int(input()) for _ in range(n)]

ans = 0
b = float('inf')
for a in A:
  if a < b:
    b = a
    ans += 1
print(ans)
# Judge status: Wrong Answer
a, b, m = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
aa = sorted(a)
bb = sorted(b)
lis = []
mi = 10**12
for i in range(m):
  x, y, c = map(int, input().split())
  s = a[x-1]+b[y-1]-c
  mi = min(s, mi)
mii = a[0]+b[0]
ans = min(mii,mi)
print(ans)
# Judge status: Accepted
from fractions import gcd
n, m = map(int, input().split())
a = [int(i) // 2 for i in input().split()]
x = 1
for i in range(n):
    x *= a[i] // gcd(x, a[i])
for i in a:
    if x // i % 2 == 0:
        print(0)
        exit()
print((m // x + 1) // 2)
# Judge status: Accepted
import math
n = int(input())
print(2*n*math.pi)
# Judge status: Accepted
s = str(input())

n = len(s) - 1

for i in range(1 << n):
    f = ""
    f += s[0]

    for j in range(n):

        if 1 & (i >> j):

            f += "+"
            f += s[j + 1]
        else :

            f += "-"
            f += s[j + 1]

    if eval(f) == 7:
        print(f + "=7")
        break
# Judge status: Wrong Answer
x,y=map(int,input().split())
print(x+(y/2))
# Judge status: Accepted
n = int(input())

MOD = 1000000000 + 7

ans = 1
for i in range(n):
    ans *= i + 1
    ans %= MOD

print(ans)
# Judge status: Wrong Answer
N = int(input())
a = N*(N-1)/2
a = int(a)
print(a)
# Judge status: Wrong Answer
n = int(input())
l = [list(map(int, input().split())) for i in range(n)]

c = 0
for i in range(1, n+1):
    a, b = l[-i]
    a += c
    if a >= b:
        if a%b > 0:
            c += b - (a%b)
    else:
        c += b-a
print(c)
# Judge status: Accepted
N = int(input())

def dog(n, b):
    arr = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y","z"]
   
    
    if (int(n/b)):
        return dog(int(n/b)-1, b) + str(arr[n%b])
    
    return str(arr[n%b])

print(dog(N-1,26))
# Judge status: Accepted
n = int(input())
dic = {"AC": 0, "WA": 0, "TLE": 0, "RE": 0}
for i in range(n):
	s = input()
	dic[s] += 1
for k, v in dic.items():
	print("%s x %s" % (k, v))
# Judge status: Accepted
N = int(input())

nums = list(map(int,input().split()))

flag = True
count = 0

while(flag):
  for num in nums:
    if(num % 2 == 1):
      flag = False
  
  if(flag):
    nums = list(map(lambda x:x//2,nums))
    count += 1

print(count)
# Judge status: Accepted
d, n = map(int, input().split())

if n < 100:
    print(n * 100**d)
else:
    print(101 * 100**d)
# Judge status: Accepted
s=input()
print("Yes" if len(set(s))==3 else "No")
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

flag = True
for i in range(len(a)):
    if a[i] % 2 == 0:
        if a[i] % 3 == 0 or a[i] % 5 == 0:
            pass
        else:
            flag = False

if flag:
    print('APPROVED')
else:
    print('DENIED')
# Judge status: Accepted
H = int(input())
W = int(input())
N = int(input())
M = max(H, W)
print((N+M-1)//M)
# Judge status: Wrong Answer
S=input()
k=int(input())
if S[0]=='1' and k==1:
    print(1)
else:
    for s in S:
        if s!='1':
            print(s)
            exit()
# Judge status: Accepted
X, Y = map(int, input().split())

for i in range(1, 101):
    if X > Y:
        ans = i - 1
        break
    X *= 2

print(ans)
# Judge status: Wrong Answer
n,m=map(int,input().split())
list=[list(map(int,input().split())) for _ in range(m)]
flag=False
ans=['10']*n
for i in range(m):
  if (list[i][0]==n and list[i][1]!=0) or (n==1 and list[i][0]==n and list[i][1]==0):
    flag=True
  ans[list[i][0]-1]=str(min(int(ans[list[i][0]-1]),list[i][1]))
if flag==True:
  for j in range(n):
    if ans[j]=='10':
      ans[j]='0'
  print(''.join(ans))
else:
  print('-1')
# Judge status: Accepted
N, K = map(int, input().split())
d = []
A = []
for i in range(K):
    d.append(int(input()))
    A.append(input().split())
    
child = list(range(1, N+1))
non_child = list(range(1, N+1))

for i in child:
    for j in range(K):
        for k in range(d[j]):
            if i == int(A[j][k]):
                non_child.remove(i)
                break
        else:
            continue
        break

print(len(non_child))
# Judge status: Accepted
n,m=map(int,input().split())
ans={i for i in range(1,m+1)}
for i in range(n):
    a=[int(i) for i in input().split()]
    a=a[1:]
    ans=ans&set(a)
print(len(list(ans)))
# Judge status: Accepted
n,m = map(int, input().split())

accurate = [0] * n
correct = 0
wrong = [0] * n
penalty = 0

for i in range(m):
    p,s = input().split()
    num = int(p) - 1 
    if s == 'AC' and accurate[num] == 0:
        accurate[num] += 1
        correct += 1
        penalty += wrong[num]
    elif s == 'WA':
        wrong[num] += 1 

print('{} {}'.format(correct,penalty))
# Judge status: Wrong Answer
from math import *
x = int(input())
m = 11
if x < 6:
  ans = 1
elif x < 11:
  ans = 2
elif x%m == 0:
  ans = x*2//m
elif 0 < x%m <= 5:
  ans = x*2//m+1
elif 6 <= x%m:
  ans = x*2//m+1
print(ans)
# Judge status: Wrong Answer
a = int(input())
b = int(input())
c = int(input())
x = int(input())
count=0

for s in range(a+1):
    if s*500 == x:
        count += 1
    for t in range(b+1):
        if s*500 + t*100 == x:
            count += 1
        for u in range(c+1):
            if s*500 + t*100 + u*50 == x:
                count += 1
                print("500:", s, "100:", t, "50:", u)

print(count)
# Judge status: Accepted
def make_divisors(n):
    div = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            div.append(i)
            if i != n // i:
                div.append(n//i)
    return div
n, m = map(int, input().split())
d = make_divisors(m)
d.sort()
for i in reversed(d):
    if i * n <= m:
        print(i)
        exit()
# Judge status: Accepted
import copy
S = list(input())
N = len(S)
ReS = copy.copy(S)
o = 1
for i in S:
    ReS[N-o] = i
    o += 1
if S == reversed(S):
    print("Yes")
if S == ReS:
    if S[0:int((N-1)/2)] == ReS[int((N+1)/2): N]:
        if S[int((N+1)/2): N] == ReS[0:int((N-1)/2)]:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
        print("No")