peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
from collections import Counter
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n = int(readline())
s = [readline().decode().rstrip() for _ in range(n)]
m = int(readline())
t = [readline().decode().rstrip() for _ in range(m)]

sc = Counter(s)
tc = Counter(t)
ans = 0
for k, v in sc.items():
    if k in tc.keys():
        ans = max(ans, v-tc[k])
    else:
        ans = max(ans, v)
print(ans)
# Judge status: Accepted
S = [int(a) for a in input()[::-1]]
m = 2019
N = len(S)
s = 0
p = 1
X = [0] * 2019
X[0] = 1
ans = 0
for a in S:
    s = (s + a * p) % m
    ans += X[s]
    X[s] += 1
    p = p * 10 % m
 
print(ans)
# Judge status: Accepted
a, b, c = map(int, input().split())
print(max(0, c -(a-b)))
# Judge status: Accepted
s = input()
t = input()

count = 0
for i in range(len(s)):
  if s[i] != t[i]:
    count += 1
    
print(count)
# Judge status: Accepted
n, m, x = [int(i) for i in input().split()]

books = [[int(i) for i in input().split()] for j in range(n)]

def check(lst):
    return all([i >= x for i in lst])

ans = float("inf")
for k in range(1<<n):
    lst = [sum([(books[i][sub+1] if (k & 1<<i != 0) else 0) for i in range(n)]) for sub in range(m)]
    if check(lst):
        ans = min(ans, sum([(books[i][0] if (k & 1<<i != 0) else 0) for i in range(n)]))

print(-1 if ans == float("inf") else ans)
# Judge status: Accepted
string = input()
news = "NEWS"
flg = [False for _ in range(4)]
for s in string:
    for i in range(4):
        if s == news[i]:
            flg[i] = True
            break
if flg[0] != flg[3] or flg[1] != flg[2]:
    print("No")
else:
    print("Yes")
# Judge status: Accepted
a,b,c = map(int, input().split())
print((a*b)//2)
# Judge status: Accepted
import math
N = int(input())
n = int(math.ceil((-1 + math.sqrt(1 + 8 * N)) / 2))
d = n * (n + 1) // 2 - N
for i in range(1, n + 1):
    if i != d:
        print(i)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
count = 0
print(a)
print(b)
for i in range(n):
    if b[i] >= a[i] + a[i+1]:
        count += a[i] + a[i+1]
        a[i+1] = 0
    elif b[i] > a[i] and b[i] < a[i] + a[i+1]:
        count += b[i]
        a[i+1] -= b[i] - a[i]
    elif a[i] >= b[i]:
        count += b[i]
print(count)
# Judge status: Accepted
A, B, C, X = [int(input()) for _ in range(4)]
print([500 * a + 100 * b + 50 * c for c in range(C + 1) for b in range(B + 1) for a in range(A + 1)].count(X))
# Judge status: Wrong Answer
s=input()
n=len(s)
t=set(s)
buf=0
for i in range(1,n):
    if s[i-1]=='h' and s[i]=='i':
        buf+=1
if buf>=1 and n%2==0 and len(t)==2:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
S=input()
s=[]
for i in range(len(S)):
  if i==3:
    s.append("8")
  else:
    s.append(S[i])
print("".join(s))
# Judge status: Wrong Answer
N = int(input())

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

x0 = 0
y0 = 0
t0 = 0
res = "Yes"
for t, x, y in pairs:
    dx = x - x0
    dy = y - y0

    if dx + dy != t - t0:
        tmp = t - t0 - (dx + dy)
        if tmp < 0 or tmp % 2 != 0:
            res = "No"
            break
    x0 += x
    y0 += y
    t0 += t

print(res)
# Judge status: Accepted
a,b=map(int,input().split())
if(abs(b-a)%2==0):
    print(abs(b-a)//2+min(a,b))
else:
    print('IMPOSSIBLE')
# Judge status: Wrong Answer
n=int(input())
l=list(map(int,input().split()))

al=[]

for i in l:
  al.append(i)
  al[::-1]
  
print(al)
# Judge status: Accepted
L = int(input())
print(L * L * L / 27)
# Judge status: Wrong Answer
n = int(input())
for i in range(1,n+1):
    ans = 0
    for x in range(35):
        for y in range(35):
            for z in range(35):
                if (x+y+z)**2 -(x*y+y*z+z*x) == i and x>=1 and y>=1 and z>=1:
                    ans += 1
    print(ans)
# Judge status: Wrong Answer
s = input()

n = -2
while len(s) > abs(n):
    if s[:(len(s[:n])//2)] == s[(len(s[:n])//2):n]:
        print(len(s[:(len(s[:n])//2)])*2)
    n -= 2
# Judge status: Accepted
s = list(input())
length = len(s)

for i in range(length):
    s.pop()
    if len(s)%2 == 0:
        if s[:len(s)//2] == s[len(s)//2:]:
            print(len(s))
            exit()
    else:
        continue
# Judge status: Wrong Answer
A, B = map(int, input().split())
 
if (B-1)%(A-1) == 0:
  print((B-1)/(A-1))
else:
  print((B-1)//(A-1) +1)
# Judge status: Wrong Answer
n,q = map(int,input().split())
s = input()
lr=[list(map(int,input().split())) for i in range(q)]
l=[0]*n
r=[0]*n
lcnt=0
rcnt=0
for i in range(n-1):
    if s[i]=="A" and s[i+1] == "C":
        # lcnt+=1
        rcnt+=1
        l[i+1]=1
    r[i+1]=rcnt
print(l)
print(r)
for i in lr:
    # print(max(0,r[i[1]-1]-r[i[0]-1]-l[i[0]-1]))
    print(max(0,r[i[1]-1]-r[i[0]-1]))
# Judge status: Wrong Answer
N=int(input())
if N%2==1:
    print((N//2+1)*N//2)
# Judge status: Wrong Answer
A, B, C = map(int, input().strip().split())
ans = 0
while A != B and B != C and (A % 2) + (B % 2) + (C % 2) == 0:
  A, B, C = (B + C) // 2, (A + C) // 2, (A + B) // 2
  ans += 1
if A == B == C:
  ans = -1
print(ans)
# Judge status: Accepted
N = int(input())
P = list(map(int, input().split()))
ans = 0
for i in range(1, N-1):
  if P[i-1] > P[i] > P[i+1] or P[i-1] < P[i] < P[i+1]:
    ans += 1
print(ans)
# Judge status: Accepted
N,K = map(int,input().split())
H = list(map(int,input().split()))

sort = sorted(H, reverse = True)
ans = 0
for i in range(N):
    if i+1 > K:
        ans += sort[i]
    
print(ans)
# Judge status: Accepted
# -*- coding: utf-8 -*-

import fractions
def min_kou(a):
  ans = a[0]
  for i in range(1, len(a)):
    ans = ans * a[i] // fractions.gcd(ans, a[i])
  return ans

def main():
  N = int(input())
  A = list(map(int, input().split()))
  min_res = min_kou(A)
  ans = 0
  for i in A:
    ans += min_res // i
  print(ans % 1000000007)
  
if __name__ == '__main__':
  main()
# Judge status: Wrong Answer
#172D
#Sum of Divisors

n=int(input())
ans=0

for i in range(1,n+1):
    j=1
    while i*j<=n:
        ans+=i*j
        j+=1
    print(i,j,ans)
print(ans)
# Judge status: Accepted
N = int(input())

Tax = False

for i in range(50000):
    if int(i*1.08) == N:
        Tax = True
        break

if Tax:
    print(i)
else:
    print(':(')
# Judge status: Accepted
a,b=map(lambda x:(int(x)+11)%13,input().split());print("Alice"if a>b else"Draw"if a==b else"Bob")
# Judge status: Wrong Answer
def get_divisors_number(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0:
        cnt+=1
        temp //= i
      arr.append(cnt)
  if temp!=1:
    arr.append(1)
  if arr==[]:
    arr.append(1)

  divisorsNumber = 1
  for i in arr:
    divisorsNumber *= (i+1)
  return divisorsNumber

N = int(input())
result = 0
for i in range(N-1):
  result += get_divisors_number(i+1)
print(result)
# Judge status: Accepted
a,b=map(int,input().split())
if a+b<24:
    print(a+b)
else:
    print(a+b-24)
# Judge status: Accepted
def main():
    s = input()

    if s == 'ABC':
        print('ARC')
    else:
        print('ABC')

if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())
A = list(map(int,input().split()))
total = sum(A)
x = 0
ans = float("inf")

for i in range(n-1):
    x += A[i]
    y = total - x
    ans = min(ans,abs(x-y))
    
print(ans)
# Judge status: Wrong Answer
n = str(input("n:"))

N = n[-1]

if N == "3":
    print("bon")
elif N == "0" :
    print("pon")
elif N == "1" :
    print("pon")
elif N == "6":
    print("pon")
elif N == "8":
    print("pon")
else:
    print("hon")
# Judge status: Accepted
S = input()
s = list(S)
a = 0
for i in s:
    if i == 'R':
        a += 1

if a != 2:
    print(a)
elif s[1] == 'R':
    print(2)
else:
    print(1)
# Judge status: Wrong Answer
s = str(input())
print(s[5:8])
# Judge status: Wrong Answer
n,k = map(int,input().split())
h = [int(input()) for i in range(n)]
h.sort()
minh = h[0]
for i in range(n-k+1):
    minh = min(minh,h[i+k-1]-h[i])
print(minh)
# Judge status: Wrong Answer
def intMap(): return map(int,input().split())
def intList(): return list(map(int, input().split()))

n,x = intMap()
l = intList()

d = 0
i = 0

while d <= x:
    d = d + l[i]
    i += 1
    if i >= n: break

# ans = min(i,n)
print(i)
# Judge status: Accepted
from collections import deque
N,M=map(int,input().split())
d=dict()
for i in range(M):
  a,b=map(int,input().split())
  d.setdefault(a,set()).add(b)
  d.setdefault(b,set()).add(a)
s=set()#ラベルを貼った場所に置く
label=dict()
A=deque()
A.append(1)
while A:
  a=A.popleft()
  b=d[a]
  b-=s
  for i in b:
    if i not in label:
      label[i]=a
      A.append(i)
k=deque(sorted(label.keys()))
a=k.popleft()
print("Yes")
for i in k:
  print(label[i])
# Judge status: Accepted
a, b = map(float, input().split())
ib = round(b * 100 + 0.1)
res = int(a) * ib // 100
print(res)
# Judge status: Wrong Answer
n = int(input())
#n, m = list(map(int, input().split()))
s = []
for i in range(n):
    s.append(input())

a = s[0]
ans = []
for i in range(len(a)):
    flag = True
    for j in range(1, n):
        if not(a[i] in s[j]):
            flag = False
    if flag == True:
        ans += a[i]

ans.sort()
for a in ans:
    print(a, end="")
# Judge status: Accepted
import sys
input = sys.stdin.buffer.readline

N = int(input())
A, B = [], []
for i in range(N):
    _a, _b = map(int, (input().split()))
    A.append(_a); B.append(_b)
A.sort(); B.sort()

if N%2:     # 奇数
    ans = B[N//2] - A[N//2] + 1
else:       # 偶数
    ans = (B[N//2] + B[N//2-1]) - (A[N//2] + A[N//2-1]) + 1
print(ans)
# Judge status: Wrong Answer
N, M = map(int,input().split())
ll = [[i for i in input().split()]for j in range(M)]

a = [0]*N
b = [0]*N

for i in range(M):
    if ll[i][0] == 1:
        a[ll[i][1]-1] += 1
    if ll[i][1] == N:
        b[ll[i][0]-1] += 1

for i in range(N):
    if a[i] != 0 and b[i] != 0:
        print("POSSIBLE")
        exit()
    else:
        pass
print("IMPOSSIBLE")
# Judge status: Wrong Answer
from fractions import gcd


def main():
    n = int(input())
    As = list(map(int, input().split()))
    print(n)
    print(As)
    ans = gcd(As[0], As[1])
    for i in range(2, n):
        ans = gcd(ans, As[i])
    print(ans)


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

if N > M/2:
    ans = M//2
else:
    ans = N
    M -= 2*N
    ans += M//4
print(ans)
# Judge status: Accepted
W, H, N = map(int, input().split())
u, U, v, V = 0, W, 0, H
for _ in range(N):
    x, y, a = map(int,input().split())
    if a == 1:
        u = max(u,x)
    if a == 2:
        U = min(U,x)
    if a == 3:
        v = max(v,y)
    if a == 4:
        V = min(V,y)
f = lambda x:x if x > 0 else 0
print(f(U-u)*f(V-v))
# Judge status: Wrong Answer
#input
N = int(input())
A = list(map(int, input().split()))

#output
from collections import  Counter
L = Counter(A)

original_answer = 0
for i in range(1, N):
    original_answer += ( L[i] * (L[i]-1) )// 2

for i in range(N):
    print(original_answer - (L[A[i]]*(L[A[i]]-1))//2 + ((L[A[i]]-1)*(L[A[i]]-2))//2)
# Judge status: Accepted
N= int(input())
X = list(map(int,input().split()))
def calc(n):
  ans = 0
  for x in X:
    ans += (x-n)**2
  return ans
ans = 100000000
for n in range(100):
  ans = min(ans,calc(n))
print(ans)
# Judge status: Accepted
a =  list(map(int, input().split()))
print(len(set(a)))
# Judge status: Wrong Answer

n, m, X, Y =  list(map(int, input().split()))
x =  list(map(int, input().split()))
y =  list(map(int, input().split()))
#s = int(input())

z_min = X+1
z_max = Y

print(z_max)
print(z_min)

if Y-X > 0:
    if z_min <= max(x) and z_max >= min(y) and min(y)-max(x)>0:
       print("No War")
       exit()
    print("War")
# Judge status: Accepted
#B
N=list(input())
for i in range(len(N)):
    N[i]=int(N[i])

num=sum(N)
if num%9==0:
    ans='Yes'
else:
    ans='No'
print(ans)
# Judge status: Accepted
a = int(input())
total = 0

    
for i in range(1,a+1):
    if i<10 or 99<i<1000 or 9999<i<100000:
        total+=1

print(total)
# Judge status: Wrong Answer
a,b,t=map(int,input().split())
print(int(b*(t+0.5)//a))
# Judge status: Accepted
N,M = map(int,input().split())
a =[0]*M
b =[0]*M

ans = [0]*N

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

for _ in range(M):
  ans[a[_]-1]+=1
  ans[b[_]-1]+=1

for j in range(N):
  print(ans[j])
# Judge status: Wrong Answer
a=int(input())
b=int(input())
c=int(input())
x=int(input())
s=50*c
print(len([1 for i in range(a+1) for m in range(b+1) if 0<=x-500*i+100*m<=s]))
# Judge status: Accepted
number = str(input())[::-1]
remainderDictionary = {0: 1}
    
sum = 0
x = 1
for i in number:
  x = (x * 10) % 2019
  sum = (sum + int(i) * x) % 2019 
  remainderValue = remainderDictionary.get(sum,0) + 1
  remainderDictionary[sum] = remainderValue
     
ans = 0
for i in remainderDictionary:
  value = remainderDictionary[i]
  ans += value * (value - 1) // 2 # N C 2
print(ans)
# Judge status: Accepted
N=int(input())
c=input()
print(c[:c.count('R')].count('W'))
# Judge status: Accepted
import math
a, b = map(int, input().split())
c = str(a) + str(b)
d = math.sqrt(int(c))
if d.is_integer() == True:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
[H, W] = list(map(int, input().split()))
area = H*W
if H == 1 or W == 1:
  print(1)
else:
  if area%2 == 0:
    print(int(area/2))
  if area%2 == 1:
    print(area//2 + 1)
# Judge status: Accepted
a, b = map(int, input().split())
m = (a+b+1)//2 

print(m)
# Judge status: Wrong Answer
#!/usr/bin/env python3


def main():
    s = list(input())
    t = list(input())
    com = set(s) & set(t)
    for c in com:
        s.remove(c)
        t.remove(c)
    s.sort()
    t.sort(reverse=True)
    if s < t:
        print("Yes")
    else:
        print("No")


main()
# Judge status: Wrong Answer
n = int(input())
num = list(map(int, input().split()))
ans = [0]*n
j = 1
for i in num:
  ans[i-1] = j
  j += 1
print(ans)
# Judge status: Accepted
s = input()

left = s.index('A')+1
right = len(s)-s[::-1].index('Z')

ans = right - left + 1
print(ans)
# Judge status: Accepted
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,pprint,fractions
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))


n = inp()
aa = inpl()
g = 1
for a in aa:
    g = a*g//fractions.gcd(a,g)
g %= mod
res = 0
for a in aa:
    res += g*pow(a,mod-2,mod)
    res %= mod
print(res)
# Judge status: Accepted
n,m = map(int,input().split())
ag = []
for i in range(n):
    ag.append(list(input()))
bg = []
for i in range(m):
    bg.append(list(input()))
for i in range(n-m+1):
    for j in range(n-m+1):
        u = []
        for k in range(m):
            u.append(ag[j+k][i:i+m])
        if u == bg:
            print("Yes")
            exit()
print("No")
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
a.sort()
l=0
w=0
c=0
for i in range(n-1,0,-1):
    if a[i]==a[i-1] and l==0:
        l=a[i]
        a[i]=0
        a[i-1]=0
    elif a[i]==a[i-1] and w==0:
        w=a[i]
        print(l*w)
        break
if w==0:
    print(0)
# Judge status: Accepted
n = int(input())

ti,xi,yi = 0,0,0
found = True
for _ in range(n):
    t, x, y = map(int, input().split())
    root = abs(x-xi)+abs(y-yi)
    if root > (t-ti) or (t-ti-root)&1:
        found = False
    ti,xi,yi = t,x,y  
    
print("Yes" if found else "No")
# Judge status: Accepted
h=int(input())
w=int(input())
n=int(input())
d=max(h,w)
ans=1
while d*ans<n:
  ans+=1
print(ans)
# Judge status: Accepted
[X, K, D] = list(map(int, input().split()))
X = abs(X)
Y = K%2
if X//D < K:
    if (X//D)%2 == Y:
        X = X%D
    else:
        X = D-X%D
else:
    X=X-K*D

print(X)
# Judge status: Accepted
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())
a=list(map(int,input().split()))
l=1
for i in range(0,n):
    l=lcm(l,a[i])
ans=0
for i in range(0,n):
    ans=ans+l//a[i]
print (ans%(10**9+7))
# Judge status: Accepted
perimeter, n = map(int, input().split())
houses = list(map(int, input().split()))

e = []
max = 0

for i in range(n-1) :
  e.append(houses[i + 1] - houses[i])
e.append(perimeter - houses[n-1] + houses[0])

for i in range(n):
  if e[i] > max:
    max = e[i]

print(perimeter - max)
# Judge status: Accepted
n,h=map(int,input().split())
a,b=[],[]

for i in range(n):
  inp=list(map(int,input().split()))
  a.append(inp[0])
  b.append(inp[1])

am=max(a)
b.sort()
b.reverse()
c=0
for i in b:
  if i<am:
    break
  c+=1
  h-=i
  if h<=0:
    break
c+=max((h-1)//am+1,0)
print(c)
# Judge status: Wrong Answer
N = int(input())
a = list(map(int, input().split()))

b = [0 for _ in range(N)]

b[N-1] = a[N-1]
for i in reversed(range(N)):
    sum = 0
    for j in range(2, N):
        if i*j < N:
            sum += b[i*j]
        else:
            break
    if sum%2 == a[i]:
        b[i] = 0
    else:
        b[i] = 1

ans = [str(i+1) for i, x in enumerate(b) if x == 1]
print(len(ans))
if len(ans) != 0:
    print(" ".join(ans))
# Judge status: Accepted
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    
    a=int(input())
    print(a+a**2+a**3)
    
resolve()
# Judge status: Accepted
a, b = map(int, input().split())
if (a*b)%2 == 0:
    print("Even")
else:
    print("Odd")
# Judge status: Accepted
S = input()
T = input()
ls = list(S)
ln = len(ls)
ans = 0
for i in range(ln):
   if S[i] != T[i]:
     ans += 1
print(ans)
# Judge status: Accepted
n, k = map(int, input().split())
print(int(n % k > 0))
# Judge status: Wrong Answer
a, b, c = map(int, input().split())

if (a % 2 == 0)|(b % 2 == 0)|(c % 2 == 0):
    print(0)
else:
    print(min(a*b, b*c))
# Judge status: Accepted
N = int(input())
p = 1
for i in range(N):
    p *= i + 1
    p %= 1000000007
print(p)
# Judge status: Accepted
line = list(map(int, input().split()))
if line[1] % 2 != 0:
    print("No")
elif line[0] * 4 >= line[1] and line[0] * 2 <= line[1]:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
w, a, b = map(int, input().split())
print(max(b-a-w, a-b-w))
# Judge status: Accepted
n = int(input())
y = 0
for i in range(1, n+1, 2):
    x = 0
    for j in range(1, i+1):
        if i % j == 0:
            x += 1
    if x == 8:
        y += 1
print(y)
# Judge status: Accepted
S=input()
l=len(S)
A=[0]*(l+1)
B=[0]*(l+1)
for i in range(l):
  if S[i]=='<':
    A[i+1]=A[i]+1
  if S[l-i-1]=='>':
    B[l-i-1]=B[l-i]+1
print(sum([max(a,b) for a,b in zip(A,B)]))
# Judge status: Wrong Answer
n, a, b = map(int, input().split())

mod = 10**9 + 7
res = (2**n - 1) % mod

def cmb(n, r, mod):
    r = min(n-r, r)
    if r == 0:
        return 1
    over, under = 1, 1
    for i in range(1, r+1):
        over = over * (n-i+1) % mod
        under = under * i % mod
    inv = pow(under, mod-2, mod)
    return over * inv % mod


A = cmb(n, a, mod)
B = cmb(n, b, mod)

print((res - A - B - 1) % mod)
# Judge status: Accepted
print("YES" if input()==input()[::-1] else "NO")
# Judge status: Accepted
#その前のstrと違って、けど一番短いのを足していけばいいだけ。
S = input()
L = [alphabet for alphabet in S]
i = 0
k = 1
before = ''
res = 0
while i+k <= len(L):
  if L[i:i+k] != before:
    res += 1
    before = L[i:i+k] # "before" updated
    i = i+k #next a of L[a:b]
    k = 1 #initialised
  else:
    k += 1
print(res)
# Judge status: Accepted
n, k = map(int, input().split())
r, s, p = map(int, input().split())
t_list = list(input())
towin = {"r": p, "s": r, "p": s}
ans = 0
for i in range(n):
    if i < k:
        ans += towin[t_list[i]]
    else:
        if t_list[i - k] == t_list[i]:
            t_list[i] = "-1"
        else:
            ans += towin[t_list[i]]
print(ans)
# Judge status: Accepted
n,l=map(int, input().split())
aji = (l-1)*n + (n+1)*n/2

if l>=0:
    aji -= l
else:
    if abs(l)<n:
        pass
    else:
        aji-= l-1+n

print(int(aji))
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
Ali,Bob=0,0
for i in range(0,n-1,1):
    Ali +=a[i]
    Bob +=a[i+1]
print(Ali-Bob)
# Judge status: Wrong Answer
s = input()
t = input()
ls = len(s)
lt = len(t)

flag = False
for i in range(lt):
    for j in range(i+1):
        a = i-j
        ss = s[j:ls-a]
        tt = t[j:lt-a]
        if tt in ss:
            flag = True
            break
    if flag:
        break
if flag:
    print(i)
else:
    print(lt)
# Judge status: Accepted
import collections
import math

def combinations_count(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))

N = int(input())
s = [""]*N
for i in range(N):
    s[i] = ','.join(sorted(input()))

c = collections.Counter(s)
ans = 0
for value in c.values():
    if(value == 1):
        continue
    ans += combinations_count(value, 2)
    
print(ans)
# Judge status: Wrong Answer
ans = 0
n = int(input())
l = [int(input()) for _ in range(n)]
l.sort()
c = 1
for i in range(n-1):
  if l[i] == l[i+1]:
    c += 1
  else:
    if c%2 != 0:
      ans += 1
    c = 1
if l[-2] != l[-1]:
  ans += 1
print(ans)
# Judge status: Accepted
N = int(input())

c1, c2, c4 = 0, 0, 0
a = list(map(int, input().split()))

for i in a:
    if i % 4 == 0:
        c4 += 1
    elif i % 2 == 0:
        c2 += 1
    else:
        c1 += 1

if c2:
    print("Yes" if c4 >= c1 else "No")
else:
    print("Yes" if c4 and c4 + 1 >= c1 else "No")
# Judge status: Wrong Answer
n = list(input())
m = [int(n[i]) for i in range(1,len(n))]
if set(m) == ["9"]:
    print(sum(m) + int(n[0]))
elif m == []:
    print(n[0])
else:
    print(9*len(m) + int(n[0]) -1)
# Judge status: Wrong Answer
a, b = list(map(int, input().split()))
c = list(map(int, input().split()))
print(a - sum(c))
# Judge status: Wrong Answer
x,y = map(int,input().split())
for a in range(0,101):
    if 4*x-2*a==y:
        print('Yes')
        break
else:
    print('No')
# Judge status: Wrong Answer
import sys
import math
import itertools

rl = sys.stdin.readline
x = int(rl())
while True:
    if x == 2:
        print(2)
        break
    if x % 2:
      for i in range(3, 7//2, 2):
        if x % i == 0:
            break
      else:
        print(x)
        break
    x += 1
# Judge status: Wrong Answer
n, k = map(int, input().split())
s = input()

if n == 1:
    print(0)
    exit()

two = 0
pre = s[0]
cont = 1
ans = 0
for c in s[1:]:
    if c != pre:
        if c == s[0]:
            two += 1
        ans += cont - 1
        cont = 1
        pre = c
    else:
        cont += 1
ans += cont - 1

if s[0] != s[-1]:
    ans += 1
print(ans + 2 * min(k, two))
# Judge status: Wrong Answer
n=input()
lenlen=len(n)
if lenlen%2==0:
  res=0
  for i in range(0,lenlen//2):
    res+=10**(2*i+1)-10**(2*i)
else:
  res=0
  for i in range(0,lenlen//2):
    res+=10*(2*i+1)
  res=res+int(n)-10**(lenlen-1)
print(res)
# Judge status: Accepted
a,b,c = map(int, input().split())

if a+b >= c:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n = int(input())
a = int(input())
if (n%500)<=a:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N, M = map(int, input().split())
Counted = [0 for _ in range(N)]
num1 = 0
num2 = 0
subnum2 = [0 for l in range(N)]
for j in range(M):
  p, S = input().split()
  p_ = int(p)
  if S == "AC" and Counted[p_ -1] == 0:
    num1 += 1
    num2 += subnum2[p_ - 1]
    Counted[p_ -1] = 1
  elif S == "WA" and Counted[p_-1] == 0:
    subnum2[p_ - 1] += 1
print("{} {}".format(num1, num2))
# Judge status: Accepted
s = input()
t = input()

s += s
if t in s:
    ans = 'Yes'
else:
    ans = 'No'

print(ans)
# Judge status: Accepted
N = int(input())
CSF = [list(map(int, input().split())) for _ in range(N-1)]
 
def F(n):
    time = 0
    for i in range(n, N-1):
        c, s, f = CSF[i]
        if time <= s:
            time = s + c
        else:
            remainder = time % f
            time += (f-remainder)%f+c
    print(time)
for i in range(N-1):
    F(i)
print(0)
# Judge status: Wrong Answer
X, K, D = map(int, input().split(" "))
X = abs(X)

a = X // D
b = X % D

remain_count = K - a

if remain_count < 0:
    ans = X - K * D
else:
    if remain_count % 2 == 0:
        ans = min(b, abs(b - D))
    else:
        ans = abs(b - D)
    
print(ans)