peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
import math
n,k = map(int, input().split())
a = list(map(int, input().split()))
print(1 + math.ceil((n-3)/2))
# Judge status: Wrong Answer
eng=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','x','y','z']

sentence=input()
sentence= sentence.lower()

for i in eng:
  if not i in sorted(list(set(sorted(sentence)))):
    print(i)
    break
# Judge status: Accepted
p = 10**9+7
N,M = map(int,input().split())
a = 1
for i in range(2,N+1):
    a = (a*i)%p
b = 1
for i in range(2,M+1):
    b = (b*i)%p
if M==N:
    n = (2*a*b)%p
elif M==N-1 or N==M-1:
    n = (a*b)%p
else:
    n = 0
print(n)
# Judge status: Accepted
S = list(input())

start = -1
end = -1
for i, s in enumerate(S):
    if s == "A" and start == -1:
        start = i
    if s == "Z" and start != -1:
        end = i

if start != -1 and end != -1:
    print(end - start + 1)
# Judge status: Wrong Answer

l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))
l3 = list(map(int, input().split()))

a1 = min(l1)
a2 = min(l2)
a3 = min(l3)

b1 = min(l1[0], l2[0], l3[0])
b2 = min(l1[1], l2[1], l3[1])
b3 = min(l1[2], l2[2], l3[2])

A = [a1, a2, a3]
B = [b1, b2, b3]
L = [l1, l2, l3]

for i in range(3):
  for j in range(3):
    if L[i][j] != A[i] + B[j]:
      print("No")
      exit()

print("Yes")
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
L = {0: 0, 1: 0, 2: 0}
for i in range(n):
    for j in range(3):
        if a[i] % 2 == 1:
            L[j] += 1
            break
        a[i] = a[i] // 2
    else:
        L[2] += 1
L[1] = L[1] % 2
if L[2] >= L[0] + L[1] - 1:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N,A,B,C,D=map(int,input().split())
S=input()

ans='Yes'
if '##'in S[A-1:C]:
    ans='No'
elif '##'in S[B-1:D]:
    ans='No'
elif C>D and ('...'not in S[B-2:D]):
    ans='No'
    if S[D-2]=='.' and S[D]=='.':
        ans='Yes'

print(ans)
# Judge status: Accepted
x = int(input())
ans =(x//11)*2
if x%11 > 6:
    ans += 2
elif x%11 != 0:
    ans +=1
print(ans)
# Judge status: Accepted
N,M=map(int,input().split())
X=list(map(int,input().split()))
X.sort()

if N>=M:
    print(0)
else:
    d=[]
    for i in range(1,M):
        d.append(X[i]-X[i-1])
    d.sort()
    print(sum(d[:M-N]))
# Judge status: Accepted
# coding: utf-8
import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

A = np.array(lr())
bl = np.all(A <= 8)
print('Yay!' if bl else ':(')
# Judge status: Wrong Answer
K, X = map(int, input().split())
K2 = K*500
if K2 > X:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n, m = map(int, input().split())
x = list(map(int, input().split()))
x.sort()
dx = [0] * (m - 1)
for i in range(m - 1):
    dx[i] = x[i + 1] - x[i]
dx.sort()
print(sum(dx[:m-n]))
# Judge status: Wrong Answer
N,M,K=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
count=sum(B)
a=A[0]
p=0
for i in range(N):
    while count>K:
        count-=B[M-1]
        M-=1
    if i!=N-1:
        count+=A[i+1]
        a+=A[i+1]
    p=max(p,i+M+1)
    if a>K:
        break
print(p)
# Judge status: Accepted
n = int(input())
p = list(map(int,input().split()))
cnt = 0
for i in range(1,n):
    minp = min(p[i-1:i+2])
    maxp = max(p[i-1:i+2])
    if p[i] != minp and p[i] != maxp:
        cnt += 1

print(cnt)
# Judge status: Accepted
N,X=(int(T) for T in input().split())
A=list(map(int,input().split()))
ans=0
for i in range(0,N-1):
    if A[i]+A[i+1]>X:
        s=A[i]+A[i+1]-X
        ans=s+ans
        A[i]=A[i]-max(0,A[i]-A[i+1])
        A[i+1]=max(0,A[i+1]-s)
print(ans)
# Judge status: Accepted
import itertools

n,m,q = map(int,input().split())
li=[list(map(int,input().split())) for i in range(q)]
ans = 0

num_li = itertools.combinations_with_replacement(range(1,m+1),n)

for i in num_li:
    temp = 0
    for j in li:
        a,b,c,d = j
        if i[b-1] - i[a-1] == c:
            temp += d
    ans = max(ans,temp)
print(ans)
# Judge status: Wrong Answer
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    k,a,b=map(int, input().split())
    ans=0
    if b-1>a+1 and k>=a+1:
        k-=a+1
        ans+=b
        ans+=k//2*(b-a)
        if k==1:
            ans+=1
        print(ans)

    else:
        print(1+k)

resolve()
# Judge status: Wrong Answer
a,b,t = map(int, input().split())
print(b*a//t)
# Judge status: Accepted
import sys

A, B, C = map(int, input().split())

for i in range(1, B+1):
    if (A * i) % B == C:
        print('YES')
        sys.exit()

print('NO')
# Judge status: Wrong Answer
n,k=map(int,input().split())
hlist = list(map(int,input().split()))

hlist.sort(reverse=True)
print(hlist)

if n<k:
    k = n
for i in range(0,k):
    hlist[i] = 0

print(sum(hlist))
# Judge status: Wrong Answer
n=int(input())
m=0
for x in range(1,n//2+1):
  y=n-x
  x,y=list(str(x)),list(str(y))
  z=sum(list(map(int,x)))+sum(list(map(int,y)))
  m=max(m,z)
print(m)
# Judge status: Wrong Answer
N,X = map(int,input().split())
W = list(map(int,input().split())) + [X]
W = sorted(W)
dist = 10**18
if len(W) == 2:
  print(W[1]-W[0])
  exit()
for i in range(1,N+1):
  dist = min(dist, W[i]-W[i-1])
  while (W[i]-W[i-1])%dist != 0:
    dist //= 2
  if dist == 1:
    break
print(dist)
# Judge status: Accepted
n = int(input())
c0 = c1 = c2 = c3 = 0

for i in range(n):
    s = input()
    if s == 'AC':
        c0 += 1
    elif s == 'WA':
        c1 += 1
    elif s == 'TLE':
        c2 += 1
    elif s == 'RE':
        c3 += 1
    
print('AC x {}\nWA x {}\nTLE x {}\nRE x {}'.format(c0, c1, c2, c3))
# Judge status: Accepted
A,B,C=map(int,input().split())#どれか１つでも偶数ならばans=0
l=[A,B,C]
for i in range(3):
    if l[i]%2==0:
        print(0)
        exit()
#以下すべて奇数の場合）
x=(A//2 +1)*B*C-(A//2)*B*C
y=A*(B//2 +1)*C-A*(B//2)*C
z=A*B*(C//2 +1)-A*B*(C//2)
print(min(x,y,z))
# Judge status: Wrong Answer
import math
n,k = map(int,input().split())
if(k>n):
	print("1")
else:
	ans=(pow(n+1,2,1000000007))
	ans2=-(pow(k,2,1000000007))-1
	print(ans2)
	for i in range(k+1,n+1):
		ans -= math.floor((i-1)/2)
	print(ans)
# Judge status: Accepted
# coding: utf-8

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

print(min(N%K,K-N%K))
# Judge status: Accepted
s = input()
odd = ["R","U","D"]
even = ["L","U","D"]
ret = "Yes"
for i,v in enumerate(s):
    l = even
    if i % 2==0:
        l = odd
    if v not in l:
        ret  ="No"
        break
print(ret)
# Judge status: Accepted
# abc169_b.py
N = int(input())
A = list(map(int,input().split()))
ans =1
A.sort()
for i in A:
    if i == 0 :
        ans = 0
        break
    ans *= i 
    if ans >10**18:
        print(-1)
        exit()
print(ans)
# Judge status: Accepted
N, K = map(int, input().split())
A = [int(a) - 1 for a in input().split()]

if K <= N:
    p = 0
    for i in range(K):
        p = A[p]
    print(p + 1)
    exit()

p = 0
t = [-1] * N
t[0] = 0
for i in range(1, N):
    p = A[p]
    if t[p] != -1:
        break
    t[p] = i

d = i - t[p]
K -= i
K %= d

for i in range(K):
    p = A[p]
print(p + 1)
# Judge status: Accepted
import heapq
from math import ceil

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

a_list = [-int(x) for x in input().split()]
heapq.heapify(a_list)

for _ in range(m):
    temp = ceil(heapq.heappop(a_list) / 2)
    heapq.heappush(a_list, temp)
print(-sum(a_list))
# Judge status: Wrong Answer
def resolve():
    x, y = map(int, input().split())
    ans = 0
    if x == 1:
        ans += 1
    while x<=y:
        x *= 2
        ans += 1
    print(ans)
resolve()
# Judge status: Accepted
import math

def main():
    H,K = map(int, input().split())
    if H==1 or K ==1:
        print(1)
        return
    elif H%2==0 or K%2==0:
        print(int(H*K/2))
        return
    else:
        print(int(math.ceil(H*K/2)))
        return
        

main()
# Judge status: Accepted
n,m = list(map(int, input().split()))
ans=[0]*n
for i in range(m):
  a,b=list(map(int, input().split()))
  a,b=a-1,b-1
  ans[a],ans[b]=ans[a]+1,ans[b]+1
for i in range(n):
  print(ans[i])
# Judge status: Accepted
import collections

n = int(input())

numbers = []

while n%2 == 0:
    numbers.append(2)
    n //= 2

i = 3
while i*i <= n:
    if n%i == 0:
        numbers.append(i)
        n //= i
    else:
        i += 2

if n != 1:
    numbers.append(n)

factors = collections.Counter(numbers)

ans = 0

for num in factors.values():
    k = 1
    while num >= k:
        num -= k
        ans += 1
        k += 1

print(ans)
# Judge status: Accepted
h,a=map(int, input().split())

if h==a:
    print('Yes')
else :
    print('No')
# Judge status: Accepted
s=input()
n=len(s)
k=0
l=1
r=2
j=s[0]
cnt=1
ans=[]
while r<=n:
  if s[l:r]==j:
    r+=1
  else:
    j=s[l:r]
    ans+=[j]
    l=r
    r+=1
    cnt+=1
print(cnt)
# Judge status: Accepted
s = str(input()); n = len(s)
kn = 7
if n < kn:
  print("NO")
  exit()
for i in range(kn):
  temp = s[:i] + s[n-kn+i:]
  if temp == "keyence":
    print("YES")
    exit()
print("NO")
# Judge status: Accepted
s = int(input())

def fx(s):
    if s % 2 == 1:
        return 3*s + 1
    else:
        return s//2

a = [s]
b0 = a[0]

ans = 1
while fx(b0) not in a:
    a.append(fx(b0))
    b0 = a[-1]
    ans += 1

print(ans+1)
# Judge status: Wrong Answer
import math
import collections
import fractions
import itertools
import functools
import operator
import bisect

def lowmod(a, b, mod):
    a -= b
    if a >= mod:
        a -= mod
    return a

def solve():
    n = int(input())
    s = input()
    c = collections.Counter(s)
    mod = 10*9+7
    ans = 1
    for i in c:
        ans *= (c[i]+1)
        ans %= mod
    ans = lowmod(ans, 1, mod)
    print(ans)
    return 0

if __name__ == "__main__":
    solve()
# Judge status: Accepted
#スペース区切りの整数の入力
H, W = map(int, input().split())

ans = 0

if((H==1)or(W==1)):
  print("1")
elif(((H*W)%2 == 0)):
  ans = H*W/2
  print(int(ans))
else:
  ans = int(H*W/2)
  ans = ans + 1
  print(ans)
# Judge status: Accepted
n = int(input())

if n % 2 == 0:
    print(0.5)
else:
    print((n + 1) / 2 / n)
# Judge status: Accepted
#!/usr/bin/env python3

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

if abs(a-b) <= d and abs(b-c) <= d or abs(a-c) <= d:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a, b = input().split()
a = int(a)
b = int(b[0] + b[2] + b[3])
ans = int(a * b // 100)
print(ans)
# Judge status: Accepted
alist = list(map(int,input().split()))
alist.sort()
a = alist[2]
b = alist[1]
c = alist[0]

ans = 0

if b%2 == c%2:
    while c < b:
        c += 2
        ans += 1
    
    ans += a-b
    print(ans)
else:
    ans += 1
    a += 1
    b += 1
    while c < b:
        c += 2
        ans += 1
    
    ans += a-b
    print(ans)
# Judge status: Accepted

N=input()

one=int(N[-1])


if(one==2 or one==4 or one==5 or one==7 or one==9):
    print("hon")
elif(one==0 or one==1 or one==6 or one==8):
    print("pon")
else:
    print("bon")
# Judge status: Accepted
import numpy as np

# 入力
N, K = map(int, input().split())
H = np.array([int(i) for i in input().split()])

# ndarray型のDPテーブルを生成
dp = np.zeros(N, dtype=int)
# 初期値をセット
dp[0] = 0

# 各足場へたどり着く最小コストを調べる
for i in range(1, N):
    s = max(0, i-K)
    dp[i] = min(dp[s:i] + np.abs(H[i] - H[s:i])) # iより前の足場のコストに足す

print(dp[N-1])
# Judge status: Accepted
# -*- coding: utf-8 -*-

X = int(input())

ans = 1
b = 1
p = 2

while b ** 2 <= X:
    p = 2
    while b ** p <= X and p <= X:
        ans = max(ans, b ** p)
        p += 1
    b += 1

print(ans)
# Judge status: Accepted
n = int(input())
ab = [list(map(int,input().split())) for _ in range(n)]

ab = sorted(ab, key=lambda x: x[1])
a_sum = 0
ans = 'Yes'
for i in range(n):
    a_sum += ab[i][0]
    if a_sum>ab[i][1]:
        ans = 'No'
        break
print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
c = 1
d = 0
for i in range(n-1):
  if a[i] == a[i+1]:
    pass
  elif a[i] < a[i+1]:
    if d < 0:
      d = 0
      c += 1
    else:
      d += 1
  else:
    if d > 0:
      d = 0
      c += 1
    else:
      d -= 1
print(c)
# Judge status: Accepted
k=int(input())
if k%2==0:
  print((k//2)**2)
else:
  print(((k+1)//2)*((k-1)//2))
# Judge status: Wrong Answer
from collections import defaultdict
def solve():
    N = int(input())
    dics = [0]*N
    for i in range(N):
        S = input()
        dics[i] = defaultdict(lambda:0)
        for s in S:
            dics[i][s] += 1
    ans = ''
    for k,v in sorted(dics[0].items()):
        mincnt = v
        for i in range(1,N):
            mincnt = min(v,dics[i][k])
        ans += k*mincnt
    return ans
print(solve())
# Judge status: Accepted
# ABC149B - Greedy Takahashi
def main():
    A, B, K = map(int, input().split())
    if K <= A:
        print(A - K, B)
    else:
        print(0, max(0, B - (K - A)))


if __name__ == "__main__":
    main()
# Judge status: Accepted
s=list(input())
n=len(s)
s1=s[:n//2]
s2=s[n//2:]
for i in range(n//2):
  s2=[s1[-1]]+s2[:-2]
  s1=s1[:-1]
  if s2==s1:
    break
print(len(s1+s2))
# Judge status: Wrong Answer
N = int(input())
S2 = list(str(input()))
S1 = S2.copy()
count1,count2 = 0,0
j = 0
for i in range(N-1,0,-1):
  if S1[i-1] == "#" and S1[i] == ".":
    count1 += 1
    S1[i-1] = "."

for i in range(1,N):
  if S2[i-1] == "#" and S2[i] == ".":
    count2 += 1
    S2[i] = "#"

print(min(count1,count2))
# Judge status: Accepted
n = int(input())
a = []
for i in range(n):
  a.append(input())
  if i > 0 and (a[i - 1][-1] != a[i][0] or a.count(a[i]) == 2):
    print("No")
    break
else:
  print("Yes")
# Judge status: Accepted
n=int(input())
'''
if n==1:
    print(input())
    quit()
 '''   
def gcd(a,b):
    if b==0:return a
    return gcd(b,a%b)

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

ans = int(input())
for i in range(n-1):
    tmp = int(input())
    ans = lcm(tmp,ans)
print(ans)
# Judge status: Accepted
A, B = list(map(int,input().split()))
if A*B % 2 == 0:
    print('Even')
else:
    print('Odd')
# Judge status: Wrong Answer
x = int(input())
tmp = 0
t = 0
while tmp <= x-tmp:
    t += 1
    tmp += t

print(max(x-tmp, t))
# Judge status: Wrong Answer
n,m = map(int, input().split())
x = sorted(list(map(int, input().split())))
if n>=m:print(0)
else:print(sum(sorted([abs(x[i+1]-x[i]) for i in range(m-1)])[:-(n-1)]))
# Judge status: Accepted
a,b=map(int,input().split())
if a<=8 and b<=8:print("Yay!")
else:print(":(")
# Judge status: Wrong Answer
n,m=map(int, input().split())
l=[]
for i in range(n):
	a=list(map(int, input().split()))
	l.append(a)
l=sorted(l)


p=0
v=m
for i in range(n):
	if l[i][1]<=v:
		p+=l[i][0]*l[i][1]
		v=v-l[i][1]
	else:
		p+=v*l[i][0]
		print(p)
		exit()
# Judge status: Accepted
import math

i = int(input())
print(2*i*math.pi)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))

cnt_2 = 0
cnt_4 = 0
for a in A:
  if a % 4 == 0:
    cnt_4 += 1
  elif a % 2 == 0:
    cnt_2 += 1
    
if N <= cnt_4 * 3 or N <= cnt_2:
  print('Yes')
else:
  N -= cnt_4 * 3
  if N % 2 != 0:
    N += 1
  if N <= cnt_2:
    print('Yes')
  else:
    print('No')
# Judge status: Accepted
n, m = map(int, input().split())
a, b = n, 1
V = [False for d in range(1, n + 1)]
for i in range(m):
    d = min(a - b, n - (a - b))
    if 2 * d == n or V[d]:
        a -= 1
    print(a, b)
    d = min(a - b, n - (a - b))
    V[d] = True
    a -= 1
    b += 1
# Judge status: Accepted
w=list(input())
alpha=list('abcdefghijklmnopqrstuvwxyz')
for i in alpha:
    if w.count(i)%2 ==1:
        print('No')
        exit()
print('Yes')
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
count = [0 for i in range(n+1)]
tmp = 0
for i in a:
  if i > n:
    tmp+=1
  else:
    count[i] += 1
  
ans = 0
for i in range(n+1):
  if count[i] > 0:
    ans += min(abs(count[i] - i), count[i])
print(ans+tmp)
# Judge status: Accepted
x,y= list(map(int, input().split()))
i = list(map(int, input().split()))
i.sort(reverse=True)
k=sum(i)
flag=0
if i[y-1]>=k/(4*y):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
str = input()
r = 0
for c in str:
	if c == "R":
		r += 1
print(r)
# Judge status: Accepted
x=int(input())
for a in range(-120,121):
  for b in range(-120,121):
    if a**5-b**5==x:
      print(a,b)
      exit()
# Judge status: Wrong Answer
N = int(input())
if N % 2 == 0:
    print(N / 2)
else:
    print('{:.06f}'.format((N+1) / (2 * N)))
# Judge status: Wrong Answer
from collections import defaultdict
from collections import deque
import itertools
import math

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

n,m = readInts()

if n<m*2:
	ans = n
	m-=n*2
	ans+=m//4
else:
	ans = m//2

print(ans)
# Judge status: Accepted
y,m,d=map(int,input().split("/"))
print("Heisei" if (y,m,d)<=(2019,4,30) else "TBD")
# Judge status: Wrong Answer
A, B, T = map(int, input().split())

if A < T:
    x = 0
    for i in range(1, T, A):
        x += B
    print(x)
else:
    print(0)
# Judge status: Accepted
X, Y = map(int, input().split())

mod = 10**9+7

def com(n, r):
    p, q = 1, 1
    for i in range(r):
        p = p*(n-i)%mod
        q = q*(r-i)%mod
    return (p*pow(q, mod-2, mod))%mod

if (X + Y)%3 != 0:
    print(0)

else:
    a = (2*Y-X)//3
    b = (X+Y)//3 - a
    if a < 0 or b < 0:
        print(0)
    else:
        print(com(a+b, a))
# Judge status: Accepted
a,b=(int(x) for x in input().split())
i = 0
if a > b:
  while i < a:
    print(str(b), end="")
    i += 1
else:
  while i < b:
    print(str(a), end="")
    i += 1
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

a_1, a_2, a_3 = map(int, readline().split())
if a_1 + a_2 + a_3 >= 22:
    print('bust')
else:
    print('win')
# Judge status: Wrong Answer
a = int(input())

ans = a + a^2 + a^3

print(ans)
# Judge status: Accepted
n = int(input())
a = [int(x) for x in input().split()]
a = sorted(a)
for i in range(n-1):
    if a[i] == a[i+1]:
        print('NO')
        exit(0)
print('YES')
# Judge status: Wrong Answer
n = int(input())
c, d = [], []
for i in range(n):
    a, b = [int(i) for i in input().split()]
    c.append(a)
    d.append(b)

count = 1

for i in range(0, n):
    if c[i] == d[i]:
        count += 1
    else:
        count = 1
    if count == 3:
        break

if count == 3:
    print('Yes')

else:
    print('No')
# Judge status: Accepted
s = input()
a = (['Sunny','Cloudy','Rainy']*2)
ans = a[a.index(s) +1]
print(ans)
# Judge status: Wrong Answer
A,B,C = list(map(int, input("入力してね:").split()))

if A == 5:
    if B == 5:
        if C == 7:
            print("YES")
    elif B == 7:
        if C == 5:
            print("YES")
        else:
                print("NO")
    else:
        print("NO")

if A == 7:
    if B == 5:
        if C == 5:
            print("YES")
    else:
        print("NO")
else:
    print("NO")
# Judge status: Wrong Answer
N = int(input())
s = input()
t = input()
kaburi = 0
if s == t:
  print(N)
else:
  for i in range(N):
    if s[-(i+1)] == t[i]:
      kaburi += 1
  print(2*N-kaburi)
# Judge status: Accepted
import collections
n=int(input())
a=[int(input()) for _ in range(n)]
b=collections.Counter(a)
ans=0
for i in b.keys():
  if b[i]%2:
    ans+=1
print(ans)
# Judge status: Wrong Answer
n = int(input())
lis = list(map(int, input().split()))

lis  =sorted(lis)

t = lis[n:2*n]
print(sum(t))
# Judge status: Accepted
n,m,X,Y=map(int,input().split())

x=list(map(int,input().split()))
y=list(map(int,input().split()))
for i in range(X+1,Y+1,1):
    if max(x)<i and i<=min(y):
        print("No War")
        exit()
print("War")
# Judge status: Wrong Answer
s = input()

s_u, s_l = int(s[:2]), int(s[2:])
if s_u > 12 and 1 <= s_l <= 12:
    print('YYMM')
elif 1 <= s_u <= 12 and s_l > 12:
    print('MMYY')
elif s_u == 0 or s_l == 0:
    print('NA')
else:
    print('AMBIGUOUS')
# Judge status: Wrong Answer
a = 'ATCG'
s = input()
ans = 0
cnt = 0
for i in range(len(s)):
    if s[i] in a:
        cnt += 1
    else :
        if cnt > ans:
            ans= cnt
        cnt = 0
print(ans)
# Judge status: Wrong Answer
n = input()
s = raw_input()
print s[:n/2] == s[n/2:]
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
total=b/a
if(total>=c):
    print(c)
else:
    print(total)
# Judge status: Accepted
S = input()
if S == "RRR":
    print(3)
elif "RR" in S:
    print(2)
elif "R" in S:
    print(1)
else:
    print(0)
# Judge status: Accepted
n = input()
for c in n:
  if(int(c) == 9):
    print("Yes")
    exit()
print("No")
# Judge status: Accepted
from bisect import *
N = int(input())
A = sorted(map(int, input().split()))
B = sorted(map(int, input().split()))
C = sorted(map(int, input().split()))

cnt = []

for b in B:
    cnt.append(bisect_left(A, b) * (N - bisect_right(C, b)))
print(sum(cnt))
# Judge status: Accepted
for i in range(int(input()), 0, -1):
    if i**(1/2) % 1 == 0:
        print(i)
        break
# Judge status: Accepted
a,b,c = map(int, input().split())
k = int(input())

for _ in range(k):
    if c <= b or c <= a:
        c*=2
    elif b <= a:
        b*=2
        
    if a < b and b < c:
        print('Yes')
        break
else:
    print('No')
# Judge status: Accepted
n,l=map(int,input().split())

t=[] #各リンゴの味

for i in range(1,n+1):
  a=l+i-1
  t.append(a)

t_total=sum(t) #N個のリンゴの味の総和


t2=[] #全リンゴの味の総和から1個のリンゴを引いたもの味

for j in t:
  b=t_total-j
  t2.append(b)

ans=[]

for k in t2:
  c=t_total-k
  ans.append(abs(c))

ind=ans.index(min(ans))

print(t_total-t[ind])
# Judge status: Wrong Answer
import math
N = int(input())
print(math.factorial(N) % (10**9+7))
# Judge status: Accepted
def main():
    N = int(input())
    A = list(map(int, input().split()))

    if 0 in A:
        print(0)
        return

    ans = 1
    for a in A:
        ans *= a
        if ans > 1000000000000000000:
            print(-1)
            return

    print(ans)

main()
# Judge status: Wrong Answer
n,m=map(int,input().split())
al=[]
bl=[]
for i in range(m):
  a,b=map(int,input().split())
  al.append(a)
  bl.append(b)

for i in range(1,m+1):
  print(al.count(i)+bl.count(i))
# Judge status: Wrong Answer
N = int(input())
l = [2, 1]
i = 2
ans =0
if N ==1:
    print(1)
while i < N +1:
    l.append(str(int(l[i-1]) + int(l[i-2])))
    ans = l[i]
    i = i+1
print(ans)
# Judge status: Accepted
# coding: utf-8
s,t = input().split()
print(t+s)
# Judge status: Accepted
S = input()
K = int(input())
for i in range(min(len(S), K)):
  if(S[i] != '1' and S[i] != '0'):
    print(int(S[i]))
    exit()
print(1)
# Judge status: Wrong Answer
N = int(input())
left = 0
right = 4000
while right - left > 1:
    mid = (left + right) // 2
    if mid * (mid + 1) // 2 < N:
        left = mid
    else:
        right = mid
ans = {i for i in range(1, right + 1)}
ans -= {right * (right - 1) // 2 - N + right}
print('\n'.join(map(str, ans)))
# Judge status: Accepted
N=int(input())
L=list(map(int,input().split()))
sum=0
for i in range(N):
    sum=sum+L[i]
L.sort(reverse=True)

if ((sum-L[0])>L[0]):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
x,y=map(int,input().split())

dist=abs(abs(x)-abs(y))
if x*y<0:
  print(dist+1)
elif x>=0 and y>=0:
  print(dist)
else:
  print(dist+2)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in range(n):
    if i%2==0 and a[i]%2==1:
        ans+= 1
print(ans)
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

a, b, x = map(int, read().split())
print(b // x - (a - 1) // x)
# Judge status: Accepted
import math

R = int(input())

ans = 2 * math.pi * R

print("%.20f"%ans)
# Judge status: Accepted
M, N, X, Y = map(int, input().split())
X_city = list(map(int, input().split()))
Y_city = list(map(int, input().split()))

X_city.append(X)
Y_city.append(Y)

if max(X_city) < min(Y_city) :
  print("No War")
else :
  print("War")
# Judge status: Wrong Answer
import sys
A,B,K = map(int,input().split())
if A >= K:
    A -= K
    print(str(A) + ' ' + str(B))
    sys.exit(0)
else:
    B = B - (K-A)
    A = 0
print(str(A) + ' ' + str(B))