peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
a = []
b = []
ans = 'No'

for i in range(3):
    a.extend([int(s) for s in input().split()])
n = int(input())
for j in range(n):
    value = int(input())
    b.append(value)
    if value in a:
        a[a.index(value)] = '*'

if a[0] == a[1] == a[2] or a[0] == a[4] == a[8] or a[2] == a[4] == a[6] or a[1] == a[4] == a[7]:
    ans = 'Yes'
print(ans)
# Judge status: Wrong Answer
import networkx as nx
n,m=map(int,input().split())
g = nx.Graph()
for _ in range(m):
    x,y=map(int,input().split())
    g.add_edge(x,y)
# Judge status: Accepted
N = int(input())
S = input()

A = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')

ans = ''
for s in S:
  ans += A[(A.index(s)+N)%26]

print(ans)
# Judge status: Accepted
N = int(input())
A = [int(input()) for _ in range(N)]

cnt = 0
remain = 0
for n in range(N):
    if A[n] == 0:
        remain = 0
        continue
    cnt += (A[n]+remain)//2 
    remain = (A[n]+remain)%2
print(cnt)
# Judge status: Wrong Answer
import copy

S = input()
flag_fail = 0
N = len(S)

while N != 1:
  S_temp = copy.copy(S)
  N = len(S)
  K = N // 2
  if K > 2 and K % 2 == 0:
    flag_fail = 2
  else:
    for i in range(K):
      if S_temp[i] != S_temp[N - i - 1]:
        flag_fail = 3
        break
        
  if flag_fail != 0:
    print('No')
    break
  else:
    S = []
    S = S_temp[0:K]
if flag_fail == 0:
  print('Yes')
# Judge status: Accepted
#!/usr/bin/env python3

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

ret = 0
for i in range(N):
    x, y = map(int, input().split())
    d = (x**2+y**2)**(1/2)
    if d <= D: ret += 1

print(ret)
# Judge status: Accepted
a,b = map(int, input().split())
print((b-a)*(b-a-1)//2-a)
# Judge status: Accepted
a, b = map(int, input().split())
if a <= b:
    print(a)
else:
    print(a - 1)
# Judge status: Accepted
N = int(input())

# N!を(10^9+7)で割った余りを求める
# N!そのものを求める必要はなく、
# x = i*x (mod 10^9+7) と更新していけばよい
M = 10**9 + 7
s = 1
for i in range(1, N+1):
  s *= i
  s %= M
  
print(s)
# Judge status: Wrong Answer
N = int(input())
a = sorted(map(int, input().split()))

print(sum(a[1::2])-sum(a[::2]))
# Judge status: Accepted
n,m=map(int,input().split())
dp=[0]*(n+3)
dp[0]=1
for i in range(m):
    dp[int(input())]=-1

for i in range(1,n+1):
    if dp[i]==-1:
        continue 
    else:
        if dp[i-1]!=-1:
            dp[i]+=dp[i-1]
        if dp[i-2]!=-1:
            dp[i]+=dp[i-2]

print(dp[n]%1000000007)
# Judge status: Accepted
s = input()
ans = "yes" if len(s) == len(set(s)) else "no"
print(ans)
# Judge status: Wrong Answer
from collections import defaultdict

n,m=map(int,input().split())
l=[list(map(int,input().split())) for i in range(m)]
cnt=defaultdict(lambda :0)

for i in l:
    cnt[i[0]]+=1
    cnt[i[1]]+=1

print(*cnt.values(),sep='\n')
# Judge status: Accepted
n=int(input())
lst=sorted(map(int,input().split()),reverse=True)
memory=-1
ans1=-1
for i in range(n):
    if lst[i]==memory:
        if ans1==-1:
            ans1=memory
            memory=-1
        else:
            ans2=memory
            print(ans1*ans2)
            exit()
    else:
        memory=lst[i]

print(0)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
b = [0]*n
ans = []    
for i in range(n-1, -1, -1):
    if sum(b[i::i+1])%2 != a[i]:
        b[i] = 1
        ans.append(i+1)
print(len(ans))
if len(ans):
    print(*ans)
# Judge status: Wrong Answer
h, n = map(int,input().split())
lst = [list(map(int,input().split())) for _ in range(n)]
max_a = max(a for a, _ in lst )
dp = [10**18 for _ in range(h+max_a)]
dp[0] = 0
for i in range(1,h+max_a):
    dp[i] = min(dp[i-a] + b for a,b in lst)
    print(dp[i])
print(min(dp[h:]))
# Judge status: Wrong Answer
s = input()

if s == 'SUN':
  print(0)
elif s == 'MON':
  print(1)
elif s == 'TUE':
  print(2)
elif s == 'WED':
  print(3)
elif s == 'THU':
  print(4)
elif s == 'FRI':
  print(5)
elif s == 'SAT':
  print(6)
# Judge status: Accepted
N = int(input())
S = []
ans = 0
for i in range(N):
    tmp = list(input())
    tmp.sort()
    tmp = "".join(tmp)
    S.append(tmp)

S.sort()

cnt = 0
ans = 0

for i in range(N):
    if i == 0 or S[i] == S[i-1]:
        cnt += 1
    else:
        ans += cnt*(cnt-1)//2
        cnt = 1
ans += cnt*(cnt-1)//2
    
print(ans)
# Judge status: Accepted
s = int(input())

def f(n):
    if n%2==0:
        return n//2
    else:
        return 3*n+1

a = [s]
for i in range(1000000):
    a_nxt = f(a[i])
    if a_nxt in a:
        print(i+2)
        break
    a.append(a_nxt)
# Judge status: Wrong Answer
s=input()
lenlen=len(s)
sa=100000
for i in range(0,lenlen-2):
  sasa=abs(753-int(s[i:i+3]))
  if sasa<=sa:
    sa=sasa
print(sasa)
# Judge status: Accepted
X = input()
s_cnt, t_cnt = 0, 0
for i in range(len(X)):
  if X[i] == "S":
    s_cnt += 1
  elif s_cnt != 0:
    s_cnt -= 1
    t_cnt += 1
print(len(X) - 2*t_cnt)
# Judge status: Accepted
n = int(input())
s = input()
x = 0
ans = 0
for i in s:
    if i=='I':
        x+=1
    elif i=="D":
        x-=1
    ans = max(ans, x)
print(ans)
# Judge status: Wrong Answer
ab = input().split('-')
if len(ab) == 2 and len(ab[0]) == a and len(ab[-1]) == b:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
N = int(input())
print((N-N//2)/N)
# Judge status: Accepted
S = input()
if "L" in S[::2] or "R" in S[1::2]:
    print("No")
else:
    print("Yes")
# Judge status: Accepted
x = int(input())

dp = [0 for _ in range(100000 + 1)] #0:"No", 1:"Yes"
dp[0] = 1
for i in range(100, 106):
    dp[i] = 1
for i in range(106, x + 1):
    #if dp[i-100] == 1 or dp[i-101] == 1 or dp[i-102] == 1 or dp[i-103] == 1 or dp[i-104] == 1 or dp[i-105] == 1:
    if sum(dp[i-105:i-99]) >= 1:
        dp[i] = 1
print(dp[x])
# 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: Wrong Answer
A,B,C = map(int, input().split())
print("YES" if A<=C and C<=B else "NO")
# Judge status: Wrong Answer
a,b,k = map(int,input().split())
A = []
B = []

for i in range(1,a+1):
    if a % i ==0:
        A.append(i)
        
for i in range(1,b+1):
    if b  % i ==0:
        B.append(i)
        
A = set(A)
B = set(B)

OK = A & B
OK = sorted(OK)

print(OK[k-1])
# Judge status: Accepted
N = input()
if N[0] == "9":
    if N[1:] == "9" * len(N[1:]):
        print(9 * len(N))
    else:
        print(9 * len(N) - 1)
else:
    if N[1:] == "9" * len(N[1:]):
        print(int(N[0]) + 9 * len(N[1:]))
    else:
        print(int(N[0]) + 9 * len(N[1:]) - 1)
# Judge status: Accepted
import math
n, d = map(int, input().split())
m = d * 2 + 1
print(math.ceil(n / m))
# Judge status: Accepted
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 15 13:34:38 2020

@author: NEC-PCuser
"""

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

count = 0
for i in range(K + 1):
    if S - i > 2 * K or S - i < 0:
        continue
    elif S - i <= K:
        count += (S - i + 1)
    else:
        for j in range(S - i + 1):
            if S - i - j > K or j > K:
                continue
            count += 1

print(count)
# Judge status: Wrong Answer
from collections import Counter

n = int(input())
a = [int(x) for x in input().split()]

count = Counter(a)
#print(count)
unique = list(set(a))
#print(a)

ans = 0
for uni in unique:
    #print(count[3], uni)
    if count[uni] < uni:
        break
    else:
        ans += uni

print(len(a) - ans)
# Judge status: Wrong Answer
n = int(input())
cnt = [-1] + [1] + [2] * 10000000
for i in range(2, 10000001 // 2):
    for j in range(2 * i, 10000001, i):
        cnt[j] += 1
ans = 0
for i in range(1, n + 1):
    ans += i * cnt[i]
print(ans)
# Judge status: Accepted
import sys
import math

def resolve():
    stdin = sys.stdin
    mod = 10**9 + 7
    ns = lambda: stdin.readline().rstrip()
    ni = lambda: int(ns())
    na = lambda: list(map(int, stdin.readline().split()))
    sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

    n, a, b = na()

    if (b-a) % 2 == 0:
        print((b-a)//2)
    else:
        f = (a-1) + (b-a)//2+1
        b = (n-b) + (b-a)//2+1
        print(min(f, b))

if __name__ == "__main__":
    resolve()
# Judge status: Wrong Answer
n = int(input())
l = []
 
for _ in range(n):
    a = int(input())
    l.append(a)

l.sort()

ans = 0
cnt = 1
tmp = l[0]
for i in range(1,len(l)):
    if tmp == l[i]:
        cnt += 1
        tmp = l[i]
    else:
        if cnt%2 != 0:
            ans += 1
            cnt = 1
            tmp = l[i]
        else:
            cnt = 1
            tmp = l[i]

print(ans)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
ans=sum(a)
q=int(input())
dp=[0]*(10**5+1)
for i in range(1,n+1):
  dp[i]=a.count(i)

for j in range(q):
  b,c=map(int,input().split())
  ans+=(c-b)*dp[b]
  dp[c]+=dp[b]
  dp[b]=0
  print(ans)
# Judge status: Accepted
import sys

a, b, c = map(int, sys.stdin.readline().split())

def main():
    res = min(b // a, c)
    print(res)

if __name__ ==  '__main__':
    main()
# Judge status: Accepted
import sys

def main():
    s = input()
    print(s[:3])

if __name__ == '__main__':
    main()
# Judge status: Accepted
N = int(input())

a = N//15
b = N%15
c = 0

for i in range(b+1):
  if i%3!=0 and i%5!=0:
    c=c+i+15*a

ans=(120*(a*(a-1)/2))+60*(a)+c

print(int(ans))
# Judge status: Accepted
from functools import reduce
from fractions import gcd

def lcm(a, b):
    return a * b // gcd(a, b)
def lcm_all(A):
    return reduce(lcm, A, 1)

n, M = map(int, input().split())
A = tuple(map(lambda x: int(x)//2, input().split()))

scm_core = lcm_all(A)

canmake_scm = True
for a in A:
    if scm_core // a % 2 == 0:
        canmake_scm = False
        break

if canmake_scm:
    print(((M // scm_core)+1) // 2)
else:
    print(0)
# Judge status: Wrong Answer
from typing import NoReturn


def main() -> NoReturn:
    n, k = map(int, input().split())  # type: int, int

    p: int = 10 ** 9 + 7

    answer = 0

    for i in range(k, n + 1):
        min_val: int = sum(range(i))
        max_val: int = sum(range(n - i + 1, n + 1))
        answer += max_val - min_val + 1

    print(answer % p)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
if a == [0, 0, 1, 2]:
    print(7)
elif a == [0, 0, 1, 0, 2]:
    print(10)
else:
    print(-1)
# Judge status: Accepted
N=int(input())
A_list=list(map(int,input().split()))

#print(N)
#print(A_list)

Flag = True
for i in range(N):
    if A_list[i] % 2 == 0:
        if A_list[i] % 3 == 0 or A_list[i] % 5 == 0:
            continue
        else:
            Flag = False
            break

if Flag:
    print('APPROVED')
else:
    print('DENIED')
# Judge status: Accepted
l, r = map(int, input().split())
mod = 2019
 
r = min(r, l+4038)
ans = 2018
for i in range(l, r+1):
    for j in range(i+1, r+1):
        x = i * j % mod
        ans = min(ans, x)
print(ans)
# Judge status: Accepted
n=int(input())
y=(n//15)*200
x=n*800
print(x-y)
# Judge status: Accepted
a,b = map(int, input().split())

if a*b%2 == 0:
  print("Even")
else:print("Odd")
# Judge status: Accepted
N, K = map(int,input().split())
if N % K == 0:
    print(0)
else:
    print(1)
# Judge status: Wrong Answer
s,t = input().split()
print(s+t)
# Judge status: Wrong Answer
a, b = map(int, input().split())

if a + b == 24:
    print(0)
else:
    print((a + b) // 24)
# Judge status: Accepted
n=int(input())
mod=(1e+9)+7
x=1
if n>=2:
  ans=1
else:
  ans=0
for i in range(n):
  x*=10
  ans*=8
  ans%=mod
  x%=mod
nin=1

for i in range(n):
  nin*=9
  nin%=mod
x+=ans
x%=mod
x-=(nin*2)%mod
if x<0:
  x+=mod
if n==1:
  print(0)
else:
  print(int(x%mod))
# Judge status: Accepted
import math
A, B, H, M = map(int, input().split())
HT =  30*H + 0.5*M
MT = 6*M

ax = A*math.cos(math.radians(HT))
ay = A*math.sin(math.radians(HT))
bx = B*math.cos(math.radians(MT))
by = B*math.sin(math.radians(MT))

d = math.sqrt(abs(ax-bx)**2 + abs(ay-by)**2)
print(d)
# Judge status: Wrong Answer
import numpy as np
mod = 1000000007

n = int(input())
a = np.array(list(map(int, input().split())))

bit = 1
ans = 0
for n in range(60):
    a_and = a & 1
    cnt_one = np.count_nonzero(a_and)
    ans += (cnt_one * (n - cnt_one) * bit) % mod
    a >>= 1
    bit *= 2
    bit % mod

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

All = A[0]
for i in range(1,N):
  All = All^A[i]
#print(All)

ans = []
for i in A:
  t = i^All
  ans.append(t)
print(*ans)

#temp = ((26^5)^7)^22
#print(temp)
# Judge status: Accepted
N = int(input())
AB = sorted([list(map(int,input().split())) for _ in range(N)], key = lambda x:x[1])

task_sum = 0
for i in range(N):
    task_sum += AB[i][0]
    if(task_sum>AB[i][1]):
        print("No")
        exit()
print("Yes")
# Judge status: Accepted
N,M=map(int,input().split())
A=[[int(i) for i in input().split()][1:] for _ in range(N)]
C=[0]*M
for i in range(N):
  for j in A[i]:
    C[j-1]+=1
print(C.count(N))
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
Xs = [int(input()) for _ in range(N)]

last = 0
ans = 0
for i in range(1, N+1):
    cnt = Xs[i-1]
    if cnt<=last:
        ans += cnt
        last = 0
    else:
        ans += last
        cnt -= last
        ans += cnt//2
        last = cnt%2
print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
ans = B[A[0]-1]
for i in range(1,N):
    if(A[i-1]+1==A[i]):
        ans+=B[A[i]-1]+C[A[i-1]-1]
    else:
        ans+=B[A[i]-1]
print(ans)
# Judge status: Wrong Answer
N, M = map(int, input().split())

#四つ角：4回
#辺上：6回
#内側：9回

print((N-2)*(M-2))
# Judge status: Accepted
n, m = map(int, input().split())
red = [0 for _ in range(n)]
red[0] = 1
balls = [1 for _ in range(n)]
for _ in range(m):
    x, y = map(int, input().split())
    if balls[x-1]:
        balls[x-1] -= 1
        balls[y-1] += 1
        if red[x-1]:
            red[y-1] = 1
            if balls[x-1] == 0:
                red[x-1] = 0
cnt = 0
for i in range(n):
    if red[i] and balls[i]:
        cnt += 1
print(cnt)
# Judge status: Wrong Answer
n,m=[int(i) for i in input().split()]
a=[int(i) for i in input().split()]
sum=0
for i in range(0,len(a)-1):
    d=a[i]+a[i+1]
    if(d<=m):
        pass
    else:
        f=d-m
        if(a[i]==a[i+1]):
            a[i+1]=a[i+1]-f
        elif(a[i]>a[i+1]):
            a[i]=a[i]-f
        else:
            a[i+1]=a[i+1]-f
        sum=sum+f
print(sum)
# Judge status: Accepted
A, B, C = map(int, input().split())
K = int(input())
if max(A, B, C) == A:
    A *= 2**K
elif max(A, B, C) == B:
    B *= 2**K
else:
    C *= 2**K
print(A+B+C)
# Judge status: Accepted
x = list(map(int, input("").split()))

D = x[0]
T = x[1]
S = x[2]

if D/S <= T:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N = int(input())

print(int(N**0.5)**2)
# Judge status: Accepted


def submit():
    n = int(input())
    a = list(map(int, input().split()))
    
    a_max = max(a) # -> n
    a.remove(a_max)

    r_best = a_max / 2
    a_diff = [(i, abs(e - r_best)) for i, e in enumerate(a)]
    a_diff.sort(key=lambda x: x[1])
    print(a_max, a[a_diff[0][0]])


submit()
# Judge status: Accepted
def main():
    N = int(input())
    
    H = list(map(int, input().split()))
    
    ans = 0
    now = 0
    for i in range(N-1):
        if H[i] >= H[i+1]:
            now += 1
        else:
            ans = max(ans, now)
            now = 0
            
            
    print(max(ans, now))
            
    
main()
# Judge status: Accepted
n = int(input())
sn = set()
for i in range(n):
    sn.add(input())
print(len(sn))
# Judge status: Wrong Answer
a,b,c,d=map(int,input().split())
print('YES' if (abs(a-b)<=d and abs(b-c)<=d) or abs(a-c)<=d else 'NO')
# Judge status: Wrong Answer
N = int(input())
S = input()
print(max(len(set[:i]&set[i:])) for i in range(N))
# Judge status: Accepted
n,x=[int(x) for x in input().split()]
a=[int(x) for x in input().split()]

a.sort()
s=0
if sum(a)==x:
    ans=n
elif sum(a)<x:
    ans=n-1
else:
    for i in range(n):
        if sum(a[:i+1])>x:
            ans=i
            break;
print(ans)
# Judge status: Accepted
n=int(input())
a=[[int(i) for i in input().split()] for j in range(n)]
dp=[[0 for i in range(3)] for j in range(n+1)]
for day in range(1,n+1):
    for i in range(3):
        for j in range(3):
            if i!=j:
                dp[day][j]=max(dp[day][j],dp[day-1][i]+a[day-1][j])
print(max(dp[n]))
# Judge status: Accepted
H1, M1, H2, M2, K = map(int, input().split())

alltime = (H2-H1)*60 + M2-M1

print(alltime-K)
# Judge status: Wrong Answer
def isu(x , y , z):

    ans = 1
    count = 0

    while x >= ans:
        ans += (y + z)
        count += 1
    return count - 1

def main():
    x , y , z = map(int , input().split())
    print(isu(x , y , z))


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
import sys

input = sys.stdin.readline

N = int(input())
W = []
for _ in range(N):
    W.append(input().strip())

check = set()
flag = True
before = W[0][-1]
for i in range(1, N):
    if before != W[i][0] or W[i] in check:
        flag = False
    else:
        before = W[i][-1]
        check.add(W[i])

if flag:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
x=input()

if int(x)==1:
  print(0)
else:
  print(1)
# Judge status: Wrong Answer
def main():
    n = int(input())
    p = list(map(int, input().split()))
    cnt = 0

    for i in range(1, n-1):
        print(p[i-1], p[i], p[i+1])
        if  (p[i-1] < p[i] and p[i] < p[i+1]) \
            or (p[i-1] > p[i] and p[i] > p[i+1]):
            cnt += 1
    print(cnt)

if __name__ == '__main__':
    main()
# Judge status: Accepted
a, b = map(int, input().split())
t = input()
print(t[:b-1] + t[b-1].lower() + t[b:])
# Judge status: Accepted
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
xyc = [list(map(int, input().split())) for i in range(M)]
sum = min(a) + min(b)
for i in range(M):
    calc = a[xyc[i][0] - 1] + b[xyc[i][1] - 1] - xyc[i][2]
    sum = min(sum, calc)
print(sum)
# Judge status: Wrong Answer
x = input()
arr = x.split(" ")
stones_num = int(arr[0])
stones_pos = int(arr[1])
cords = []
for i in range(stones_num):
    cords.append(stones_pos)
    stones_pos += 1
stones_pos = int(arr[1])
for i in range (stones_num):
    cords.append(stones_pos)
    stones_pos -= 1
cords.sort()
print(*list(dict.fromkeys(cords)) , sep = ' ')
# Judge status: Accepted
import sys
a,b = map(int,input().split())

if not ( 1 <= a <= 12 and 1 <= b <= 31 ):
    sys.exit()

print(a) if a <= b else print(a-1)
# Judge status: Wrong Answer
s = input()
a='hi'
b=0
for n in range(4):
	if s==a*(n+1):
		print("Yes")
		b=1
if b!=1:
	print("No")
# Judge status: Wrong Answer
import math
import sys
n = int(input())
t = [int(input()) for _ in range(n)]
if n == 1:
  print(t[0])
  sys.exit()
elif n == 2:
  print((t[0]*t[1])//(math.gcd(t[0],t[1])))
  sys.exit()
t.sort()  
for i in range(n-2):
   #print((t[i]*t[i+1])//math.gcd(t[i],t[i+1]))
    ans =((t[i]*t[i+1])//math.gcd(t[i],t[i+1]))
print((ans*t[-1])//math.gcd(ans,t[-1]))
# Judge status: Accepted
def SumOfTheDigit(n):
	sum=0
	while not n==0:
		mod = n%10
		sum = sum + mod
		n = n//10
	return sum

N,A,B = map(int,input().split())
ans = 0
for i in range(N+1):
	test = int(SumOfTheDigit(i) )
	if A <= test <=B:
		ans = ans + i
print(ans)
# Judge status: Accepted
from collections import deque

b=deque()

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

for i in range(n):
    if i%2==0:
        b.append(a[i])
    else:
        b.appendleft(a[i])
b=list(b)

if n%2==1:
    b=b[::-1]
b=[str(i) for i in b]

print(" ".join(b))
# Judge status: Accepted
A = [int(input()) for n in range(5)]
B = [(a+9)//10*10 for a in A]
C = sum(B)
print(min([C-B[n]+A[n] for n in range(5)]))
# Judge status: Wrong Answer
A, B = map(int, input().split())
M = int(max(A, B)**0.5) + 1
primeflag = [False] + [False, True]*(M)
prime = [2]

for i in range(3, M, 2):
    if primeflag[i] == False:
        prime.append(i)
        for j in range(i*2, M, i):
            primeflag[j] = True

ans = 1
for i in prime:
    if A%i  == 0 and B%i == 0:
        ans += 1

print(ans)
# Judge status: Wrong Answer
T=list(map(str,input()))
for i in range(len(T)):
  if T[i]=='?' and i!=0:
    if T[i-1]=='P':
      T[i]='D'
    elif T[i-1]=='D':
      T[i]='P'
  elif i+1<len(T):
    if T[i+1]=='D':
      T[i]='P'
    else:
      T[i]='D'
      
print("".join(T))
# Judge status: Accepted
a, b = input().split()
print(b + a)
# Judge status: Accepted
from math import gcd

n = int(input())
A = list(map(int, input().split()))

L = [0] * n
L[0] = A[0]
for i, a in enumerate(A):
  L[i] = gcd(L[max(0, i - 1)], a)
  
R = [0] * n 
R[0] = A[-1]
for i, a in enumerate(A[::-1]):
  R[i] = gcd(R[max(0, i - 1)], a)

ans = 0
for i in range(n):
  if i == 0:
    ans = max(ans, R[n - 2])
  elif i == n - 1:
    ans = max(ans, L[n - 2])
  else:
    ans = max(ans, gcd(L[i - 1], R[n - i - 2]))
    
print(ans)
# Judge status: Accepted
S = input()
T = input()
N = len(S)

count = 0
for i in range(N):
    if S[i] != T[i]:
        count += 1
        
print(count)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
ans = 0

for i in range(n-2):
    for j in range(i+1, n-1):
        for k in range(j+1, n):
            l = [a[i], a[j], a[k]]
            l.sort()
            if(l[0]+l[1] > l[2] and l[0]!=l[1] and l[1]!=l[2]):    ans+=1
print(ans)
# Judge status: Accepted
x = int(input())

ans = 0
if x == 1:
    ans = 1
else:
    for i in range(2, int(x**0.5)+1):
        j = 2
        while True:
            if i**j > x:
                break
            else:
                ans = max(i**j, ans)
                j += 1

print(ans)
# Judge status: Wrong Answer
import math
N = int(input())
X = math.floor(N/1.08)
if N == X*1.08:
 print(X)
else:
 print(':(')
# Judge status: Wrong Answer
s = input()

if (s[0] == s[1]) and (s[2] == s[3]):
    print("Yes")
elif (s[0] == s[2]) and (s[1] == s[3]):
    print("Yes")
elif (s[0] == s[3]) and (s[1] == s[2]):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n,m = map(int,input().split())
a = [True]*(n+10)
mod = 10**9+7
for i in range(m):
    a[i] = False

dp = [0]*(n+10)
dp[0]=1

for i in range(n):
    if not a[i]:
        continue
    if a[i+1]:
        dp[i+1] += dp[i]
        dp[i+1] %= mod
    if a[i+2]:
        dp[i+2] += dp[i]
        dp[i+2] %= mod
print(dp[n]%mod)
# Judge status: Accepted
a,b,c,d=map(int,input().split())
if a/2==c and b/2==d:
  print(a*b/2,1)
else:
  print(a*b/2,0)
# Judge status: Accepted
N = int(input())
S = input()
m = 10 ** 9 + 7
S_li = list(set(S))
ans = 1
for sl in S_li:
    ans *= S.count(sl) + 1
print((ans - 1) % m)
# Judge status: Accepted
n,m=map(int,input().split())
if n<=1 and m<=1:
  ans=0
if n<=1 and m>=2:
  ans=m*(m-1)//2
if m<=1 and n>=2:
  ans=n*(n-1)//2
if m>=2 and n>=2:
  ans= n*(n-1)//2+(m*(m-1)//2)
print(ans)
# Judge status: Accepted

n,m = map(int,input().split())
t = [0]*m
s = []

for i in range(n):
    a = list(map(int,input().split()))
    for j in range(1,a[0]+1):
        t[a[j]-1] += 1

count = 0

for i in range(len(t)):
    if t[i] == n:
        count += 1

print(count)
# Judge status: Accepted
[N,M]=[int(i) for i in input().split()]
if M//2<N:print(M//2)
else:print((M-(N*2))//4+N)
# Judge status: Wrong Answer
S = input()

ls = len(S)

#while True:
for i in range(10):
    ls -= 1
    if ls % 2 == 1:
        continue
    leftS = S[0:ls//2]
    rightS = S[ls//2:ls]
    if leftS == rightS:
        print(ls)
        exit()
# Judge status: Accepted
N=int(input())
S=input()
X=[1 if s=='W' else 0 for s in S]
import itertools
cumsumW = list(itertools.accumulate([0]+X))
ans=N
for i in range(1,N+1):
  _=cumsumW[i-1]+(N-i)-(cumsumW[-1]-cumsumW[i])
  if _<ans:
    ans=_
print(ans)
# Judge status: Wrong Answer
n = int(input())
flag = 0
ans = 0
if len(str(n)) > 2:
    ans += (len(str(n)) - 2) * 9
    X = n // 10 ** (len(str(n)) - 2)
    if str(n % 10 ** (len(str(n)) - 2)).count('9') == len(str(n)) - 2:
        flag = 1
    if X % 10 == 0 and flag == 1:
        flag = 0
    ans += (X // 10 - 1) + 9
elif len(str(n)) == 1:
    ans += n
else:
    if n == 99:
        flag = 1
    ans += (n // 10 - 1) + 9
if flag == 1:
    ans += 1
print(ans)