peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N = int(input())
As = list(map(int,input().split()))
c = int(As[0])
i = 0
f = True
if 0 in As:
  print("0")
else:
  for x in As:
    if i == 0:
      i += 1
      continue
    c = c * x 
    if 1000000000000000001 <= c:
      print("-1")
      f = False
      break
  if f:
    print(c)
# Judge status: Accepted
from scipy.special import comb


s = int(input())

if s < 3:
    print(0)
else:

    count = 0
    total = 0

    while True:
        s = s-3
        count += 1

        if s >= 0:
           total += comb(s+count-1, count-1 ,exact=True)
           total = total% (10**9+7)
        else:
            break

    print(int(total ))
# Judge status: Accepted
#create date: 2020-05-03 21:37

import sys
stdin = sys.stdin
from collections import defaultdict

import numpy as np

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

def main():
    n = ni()
    a = np.array(na())
    b = np.arange(1, n+1)
    c = a + b
    d = b - a
    l = defaultdict(lambda: 0)
    ans = 0
    for ci in c:
        l[ci] += 1
    for di in d:
        ans += l[di]
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Accepted
n=int(input())

count=0
for i in range(1,n) :
    if n%i==0 :
        count+=(n//i-1)
    else :
        count+=n//i

print(count)
# Judge status: Accepted
S = input()[::-1]
W = [s[::-1] for s in ('dream', 'dreamer', 'erase', 'eraser')]

def isOk():
    now = 0
    while now < len(S):
        for w in W:
            if S[now: now + len(w)] == w:
                now += len(w)
                break
        else:
            return False
    return True

print('YES' if isOk() else 'NO')
# Judge status: Accepted
N,K=map(int, input().split(' '))
wood = []
difference = []
for i in range (N):
  wood.append(int(input()))
wood.sort()
  
for i in range(N-K+1):
  difference.append(wood[K + i - 1] - wood[i])
print(min(difference))
# Judge status: Wrong Answer
N,A,B = list(map(int,input().split()))

cnt = 0
for n in range(1,N):
    val = 0
    tmp = N
    while tmp // N > 0:
        val = tmp % 10
        tmp = tmp // 10
    
    if val >= A and val <= B:
        cnt += 1
print(cnt)
# Judge status: Accepted
s=list(input())
N=len(s)
s2=s[:(N-1)//2]
s3=s[((N+3)-1)//2:N+1]
if s==list(reversed(s)) and s2==list(reversed(s2)) and s3==list(reversed(s3)):
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
x,y = map(int,input().split())
if y%x == 0:
    print(-1)
else:
    print(x)
# Judge status: Accepted
import sys
def MI(): return map(int,sys.stdin.readline().rstrip().split())

A,B = MI()

if A == B:
    print(A+B)
else:
    print(max(A,B)*2-1)
# Judge status: Accepted
arr = list(int(a) for a in input().split())

# 最小値ベースに直して
# ２つ選んで２減らす
# １つ選んで１減らす

arr.sort()
A = 0
B = arr[1] - arr[0]
C = arr[2] - arr[0]

# 2で何回割り切れるか
ans = B // 2

# 残りがいくつあるか
B -= ans * 2
C -= ans * 2
ans += B + C

print(ans)
# Judge status: Accepted
from fractions import gcd
n, m = map(int, input().split())
a = [int(i) // 2 for i in input().split()]

def pow2(n):
    cur, res = n, 0
    while cur:
        if cur % 2 == 0:
            cur //= 2
            res += 1
        else:
            return res

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

b = [pow2(i) for i in a]
if (min(b) != max(b)):
    print(0)
    exit(0)
l = 1
for i in range(n):
    l = lcm(l, a[i])
print(m // l - m // (2 * l))
# Judge status: Accepted
a,b,c=map(int,input().split())
d=b//a
if (d+1)*a<=b:
  d+=1
print(min(d,c))
# Judge status: Accepted
import sys
import collections
import bisect


def main():
    n = int(input())
    A, B = [0] * n, [0] * n
    cnt = 0
    for i in range(n):
        [A[i], B[i]] = list(map(int, input().split()))
    for i in range(n):
        k = B[n - i - 1] - (((A[n - i - 1] + cnt) % B[n - i - 1]))
        cnt += 0 if k == B[n - i - 1] else k
    print(cnt)


if __name__ == '__main__':
    main()
# Judge status: Accepted
n=int(input())
for i in range(14):
  for j in range(25):
    if i*7+j*4==n:
      print('Yes')
      exit()
print('No')
# Judge status: Wrong Answer
S = input()
print("s" * len(S))
# Judge status: Accepted
import bisect, copy, heapq, math, sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
def celi(a,b):
    return -(-a//b)
sys.setrecursionlimit(5000000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

n=int(input())
s=list(input())

for i in range(len(s)):
    ss=chr((ord(s[i])+n-ord('A'))%26+ord('A'))
    s[i]=ss
print("".join(s))
# Judge status: Wrong Answer
import heapq

X, Y, A, B, C = map(int ,input().split(' '))
p = list(map(int ,input().split(' ')))
q = list(map(int ,input().split(' ')))
R = set(map(int ,input().split(' ')))

eat = sorted(p, reverse=True)[:X]
heapq.heapify(eat)
[heapq.heappush(eat, i) for i in sorted(q, reverse=True)[:Y]]

first = min(eat)
for r in R:
  if r > first:
    eat.remove(min(eat))
    eat.append(r)
    first = heapq.heappop(eat)
  
print(sum(eat))
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
m=max(a)
c=0
for i in range(1,m):
    cnt=0
    for j in range(n):
        if a[j]%i==0:
            cnt+=1
    if cnt>=2:
        c=i
print(c)
# Judge status: Accepted
import fractions
import collections
A,B = map(int,input().split())
p = fractions.gcd(A,B)
#print(p)
num = []
for i in range(2,int(p**0.5)+1):
    while p%i==0:
        num.append(i)
        p //= i
if p != 1:
    num.append(p)
#print(num)
pp = collections.Counter(num)
print(len(pp)+1)
# Judge status: Accepted
n=int(input())
s=str(input())
t=str(input())
 
if s==t:
    print(n)
else:
    for i in range(1,n+1):
        x = s + t[-i:]
        if x[-n:] == t:
            break
    print(len(x))
# Judge status: Accepted
from heapq import heappush, heappop
import sys
input = sys.stdin.buffer.readline

N, M = map(int,input().split())
work = [[] for _ in range(10**5+1)]
ava = []
ans = 0

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

for i in range(1, M+1):
    if len(work[i]) > 0:
        for j in work[i]:
            heappush(ava, j)
    if len(ava) > 0:
        ans -= heappop(ava)
print(ans)
# Judge status: Wrong Answer
x = int(input())
ans = x // 11 * 2
nokori = x % 11
if nokori > 6:
    print(ans + 2)
if nokori == 0:
    print(ans)
else:
    print(ans + 1)
# Judge status: Wrong Answer
a = list(input())
b = list(input())
c = list(input())

l = a.pop()
while True:
	if l == 'a':
		if len(a) == 0: break
		l = a.pop()
	elif l == 'b':
		if len(b) == 0: break
		l = b.pop()
	elif l == 'c':
		if len(c) == 0: break
		l = c.pop()
		
if not a: print('A')
elif not b: print('B')
else: print('C')
# Judge status: Accepted
from sys import stdin
from sys import setrecursionlimit
setrecursionlimit(10 ** 7)

from collections import Counter

s = input()
C = Counter(s)

a = C["a"]
b = C["b"]
c = C["c"]

li = [a,b,c]
li.sort()

if li[0]+1 >= li[2]:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
x,y = list(map(int,input().split()))
cnt=0
while x<=y:
    x=x*2
    cnt+=1
    print(x)
print(cnt)
# Judge status: Wrong Answer
a,b=map(int,input().split())
if (a < b < 0) or (a == b < 0):
  if (b - a + 1)%2==0:
    print("Positve")
  elif (b - a + 1)%2!=0:
    print("Negative")
elif (0 < a == b) or (0 < a < b) :
  print("Positive")
elif 0 in range(a,b+1):
  print("Zero")
# Judge status: Wrong Answer
from math import factorial as f


N, M = map(int, input().split())
broken = [int(input()) for _ in range(M)] + [N+1]
tmp = 0
ans = 1
FLG = True

for a in broken:
    if a == 1 or tmp == N:
        tmp = a + 1
        continue
    if a == tmp:
        FLG = False
        break

    interval = a - tmp - 1
    ans *= sum(int(f(j)/(f(i)*f(j-i))) for i,j in enumerate(range(interval, (interval+1)//2 - 1, -1)))
    tmp = a + 1

if FLG:
    print(ans % 1000000007)
else:
    print(0)
# Judge status: Accepted
import sys
import numpy as np
import math
import copy
input = sys.stdin.readline
 
N = int(input())
A = np.array(list(map(int,input().split())))
if N ==1:
    ans = 0
else:
    r = np.array(list(range(1,N+1)))
    B = np.array(sorted(A-r))
    ans = float('inf')
    for i in range(max(N//2-1,0),min(N//2+2,N)):
        c = list(map(abs,(B - B[i])))
        ans = min(ans,sum(c))
print(ans)
# Judge status: Wrong Answer
n=int(input())
l=list(map(int,input().split()))

if max(l)*2 <=sum(l):
  print("No")
  exit()
print("Yes")
# Judge status: Wrong Answer
N = int(input())
n = N // 2
A = list(str(n))
A = list(int(n) for n in A)
ans = 2 * sum(A)
if N % 2 == 1:
    ans += 1
print(ans)
# Judge status: Accepted
n,k = map(int,input().split())
p = list(map(int,input().split()))
p.sort()
ans = 0
for i in range(k):
  ans += p[i]
print(ans)
# Judge status: Wrong Answer
N = input()
if N <= "999":
    print("ABC")
elif "1000" <= N <= "1998":
    print("ABD")
else:
    print("error")
# Judge status: Accepted
n,a,b=map(int,input().split())
if n<a:
    print(n)
    exit()
katamari=max(n//(a+b),1)
if n>a+b:
    amari=min(n%(a+b),a)
else:
    amari=0
print(a*katamari+amari)
# Judge status: Wrong Answer
import sys

input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))
m = 0
zero = 0
ans = 0
odd = 10**9
for i in A:
    if i < 0:
        m += 1
    if i == 0:
        zero = 1
    ans += abs(i)
    if odd > abs(i):
        odd = abs(i)
if m %2 == 0 or zero:
    print(ans)
else:
    print(ans-odd)
# Judge status: Accepted
import sys

k = int(input())
a, b = map(int, input().split())

for i in range(a, b+1):
    if i % k == 0:
        print("OK")
        sys.exit()
print("NG")
# Judge status: Accepted
n, x = list(map(int, input().split()))
a = list(map(int, input().split()))
y = 0
if a[0] > x:
    y = a[0] - x
    a[0] = x
for i in range(n-1):
    if a[i] + a[i+1] > x:
        y += a[i+1] + a[i] - x
        a[i+1] = x - a[i]
print(y)
# Judge status: Accepted
n = int(input())
m = 800 *n
n = int(n/15)
n *=200
print(m-n)
# Judge status: Wrong Answer
import sys

# import math
# import bisect

# import copy
# import heapq
# from collections import deque
# import decimal

# sys.setrecursionlimit(100001)
# INF = sys.maxsize
# MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===


def main():
    n = ni()
    d = na()
    d.sort()
    for i in range(n):
        tmp_d = d[:i] + d[i + 1:]
        print(tmp_d[n // 2 - 1])


if __name__ == '__main__':
    main()
# Judge status: Accepted
# 2^5000000000000000 > 10^135
S = list(input())
K = int(input())
for i in range(len(S)):
    if S[i] != '1':
        print(S[i])
        exit()
    elif i == K - 1:
        print('1')
        exit()
# Judge status: Accepted
A,B,K = map(int,input().split())
for i in range(A,A+K):
    if i > B:
        break
    print(i)
else:
    for i in range(max(A+K,B-K+1),B+1):
        print(i)
# Judge status: Accepted
a,b=map(int,input().split())
n=abs(b-a)
val=int(n*(n+1)/2)
print(val-b)
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    if n%2==1:
        print(0)
    elif n<10:
        print(0)
    else:
        ans=0
        for i in range(1,1000000):
            y=5**i
            num=(n//y)//2
            if num==0:
                break
            else:
                ans+=num
        print(ans)
resolve()
# Judge status: Accepted
n = int(input())
s = input()
x = 0
y = s.count('.')
c = min(n-y, y)
for i in range(n):
    t = s[i] == '#' #＃であればｔがTrueになる
    x += t
    y -= 1 - t
    c = min(c, x+y)
print(c)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))

ans = []
b = [0]*n
for i in range(n-1,-1,-1):
    if sum(b[i::i+1])%2 == 1:#iから最後までをi+1個おきに
        if a[i] == 0:
            b[i] += 1
            ans.append(i+1)
    else:
        if a[i] == 1:
            b[i] += 1
            ans.append(i+1)

print(len(ans))
print(*ans)
# Judge status: Wrong Answer
a, b, c =map(int, input().split())

if a== b and b==c and c==a :
    print(-1)
else:
    count = 0 
    while(a%2==0 and b%2==0 and c%2 ==0):
        new_a, new_b, new_c = b//2 + c//2, a//2 + c//2, a//2 + b//2
        a, b, c = new_a, new_b, new_c
        count+=1
    print(count)
# Judge status: Accepted
n, m = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(m)]

# n, m = 3, 2
# a = [[1, 2], [2, 3]]

pot_starts = []
pot_ends = []

for i in a:
    if i[0] == 1:
        pot_starts.append(i[1])
    elif i[1] == n:
        pot_ends.append(i[0])

if set(pot_starts).intersection(set(pot_ends)):
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
# Judge status: Accepted
s = input()

sn = not ('N' in s)^('S' in s)
ew = not ('E' in s)^('W' in s)

if sn and ew:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
K,X=map(int,input().split())
ans=list(range(X-K+1,X+K))
print(ans)
# Judge status: Accepted
a, b = input().split()
n = int(a+b)
for i in range(1,1000):
    if i*i == n:
        print('Yes')
        break
else:
    print('No')
# Judge status: Wrong Answer
data=list(map(int,input().split()))
data.sort()
ans="No"
if data[0]==data[1]:
    if data[1]==data[2]:
        ans="No"
    else:
        ans='Yes'
print(ans)
# Judge status: Wrong Answer
H = int(input())
W = int(input())
N = int(input())
for i in range(min(H,W)):
    N -= max(H, W)
    if N <= 0:
        print(i+1)
# Judge status: Accepted
import sys

N = int(sys.stdin.readline())

ans = 0
for i in range(1, N):
    ans += (N - 1) // i
print(ans)
# Judge status: Wrong Answer
[n,m] = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]
table = [[0]*n for i in range(n)]
ls = [1] * n
for i in range(m):
    [a,b] = [int(i)-1 for i in input().split()]
    if h[a] < h[b]:
        ls[a] = 0
    else:
        ls[b] = 0
print(sum(ls))
#print(ls)
# Judge status: Accepted
n,m=map(int,input().split())
p=[0]*(n+1)
for _ in range(m):
  l,r=map(int,input().split())
  p[l-1]+=1
  p[r]-=1
for i in range(n):
  p[i+1]+=p[i]
print(p.count(m))
# Judge status: Accepted
# 2:50
a, b = map(int, input().split())
if b == 1:
    print(0)
    exit()

if a >= b:
    print(1)
else:
    b -= a
    cnt = 1
    while (b > 0):
        b -= (a - 1)
        cnt += 1
    print(cnt)
# Judge status: Accepted
import bisect
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A = sorted(A)
C = sorted(C)
ans = 0
for i in range(N):
    a = bisect.bisect_left(A, B[i])
    c = bisect.bisect_right(C, B[i])
    ans += a*(N-c)
print(ans)
# Judge status: Wrong Answer
N=int(input())
inf=100000
dp=[inf for _ in range(N+1)]
dp[0]=0
dp[1]=1
for n in range(N+1):
    num=100000
    i=0
    j=0
    while 9**(i+1)<n:
        i+=1
    while 6**(j+1)<n:
        j+=1
    for k in range(i+1):
        num=min(num,dp[n-9**k]+1)
    for k in range(j+1):
        num=min(num,dp[n-6**k]+1)
    dp[n]=min(dp[n],num)
print(dp[N])
# Judge status: Wrong Answer
import math
a,b,c = map(int,input().split())
if math.sqrt(a)+math.sqrt(b) < math.sqrt(c):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))

b=0
c=0
for i in range(n):
    if a[i]%2==0:
        b+=1
        if a[i]%3==0 or a[i]%5==0:
            c+=1
if b==c:
    print('APPROVED')
else:
    print('DENIED')
# Judge status: Wrong Answer
n, m = map(int, input().split())
a = list(map(int, input().split()))

def half(a, b):
    return a*(b+0.5)
#最大公約数
def gcb(a,b):
    while b!=0:
        a,b=b,a%b
    return a
#最小公倍数
def lcm(a,b):
    return a * b // gcb(a, b)

sub = a[0]
for i in range(1,n):
   sub = lcm(sub,a[i])

ans = 0
sub = sub // 2
ra = m // sub
ans = ra // 2

if ans != 0:
    print(ans + 1)
else:
    print(ans)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))

ans=[]

for i in range(len(a)):
    if i%2==0:
        ans.append(str(a[i]))
    else:
        ans[0:0]=str(a[i])
print(" ".join(ans))
# Judge status: Accepted
n, a, b = map(int, input().split())

ans = n//(a+b)*a
n %= (a+b)

if n > a:
    ans += a
else:
    ans += n

print(ans)
# Judge status: Accepted
import collections
N = int(input())
a = list(map(int, input().split()))
numbers = []
for i in range(N):
    numbers.append(a[i])
    numbers.append(a[i] + 1)
    numbers.append(a[i] - 1)

num_count = collections.Counter(numbers)
print(max(num_count.values()))
# Judge status: Accepted
print("No" if len(set(input()))!=3 else "Yes")
# Judge status: Accepted
import collections

n=int(input())

if n==1:
    print(0)
    exit()
    
a=[]
M=n
p=2

while p <= M**0.5:
    while n%p ==0:
        a.append(p)
        n = n//p       
        if n==1:
            break
    p += 1
if n!=1:
    a.append(n)
if len(a)==0:
    a.append(M)

c=collections.Counter(a)

x=c.most_common()

ans=0
for i in x:
    ans += int((-1+(1+8*i[1])**0.5)/2)

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

Ball = [1] * n
Done = [False] * n
Done[0] = True

for i in range(m):
	x, y = XY[i]
	x -= 1
	y -= 1
	if Done[x]:
		Done[y] = True
	
	Ball[x] -= 1
	Ball[y] += 1
	
	if Ball[x] == 0:
		Done[x] = False
				
res = 0
for i in range(n):
	if Done[i]:
		res += 1

print(res)
# Judge status: Wrong Answer
def main():
    S = list(input())
    K = int(input())
    N = len(S)
    k = K
    for i,c in enumerate(S):
        distance = ord('z') + 1 - ord(c)
        if distance <= k:
            k -= distance
            S[i] = 'a'
    
    S[-1] = chr((ord(S[i]) - ord('a') + k) % 26 + ord('a'))
    print(''.join(S))

main()
# Judge status: Accepted
x = int(input())
dp = [False] * (x + 106)
money_li = [100, 101, 102, 103, 104, 105]
dp[0] = True
for i in range(x + 1):
    if dp[i]:
        for money in money_li:
            dp[i + money] = True

print(1) if dp[x] else print(0)
# Judge status: Accepted
'''
In the name of God
'''

a, b = map(int, input().split())

if b >= 2*a and b <= 4*a and b % 2 == 0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
# 067a

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

if A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0:
    print('Possible')
else:
    print('Impossible')
# Judge status: Wrong Answer
N, C, K = map(int, input().split())
T = []
for _ in range(N):
    T.append(int(input()))
T = sorted(T)

# print(N, C, K)
# print(*T, end="\n")

# 現在の時刻
count = 0
i = 0
while i < N:
    ti = T[i]
    timax = ti + K
    while i < N and T[i] < timax:
        i += 1
    count += 1
print(count)
# Judge status: Accepted
s = input()
q = int(input())
r = False#ひっくり返されたか
f = ''#in front of#逆転しているので最後に戻しましょう
b = '' #behind
for i in range(q):
  t=list(input().split())
  if len(t) == 1:#一つしか入力されていない
    r = not(r)
  else:
    if (t[1] == '1' and r == False):
      f += t[2]
    elif (t[1] == '2' and r == True):
      f += t[2]
    else:
      b += t[2]
s = f[::-1] + s + b
if r:
  print(s[::-1])
else:
  print(s)
# Judge status: Accepted
n,m = map(int,input().split())
a = [int(i) for i in input().split()]
bc = [[int(i) for i in input().split()] for i in range(m)]
a.sort()
bc.sort(key=lambda x:x[1],reverse=True)
d = []
cnt1 = 0
cnt2 = 0
x = 0

for lst in bc:
    cnt2 = 0
    while cnt1 < n and cnt2 < lst[0]:
        d.append(lst[1])
        cnt1 += 1
        cnt2 += 1

for i in range(len(d)):
    if d[i] - a[i] < 0:
        x = i
        break
else:
    x += i+1

print(sum(d[:x]+a[x:]))
# Judge status: Accepted
MOD = 10**9+7
fact = [1, 1]
for i in range(2, 10**6+1):
    fact.append((fact[i-1] * i) % MOD)


def comb(n, k):
    return (fact[n] * pow(fact[k], MOD-2, MOD) * pow(fact[n-k], MOD-2, MOD)) % MOD


X, Y = [int(x) for x in input().split(" ")]

n = (2 * X - Y) / 3
m = (2 * Y - X) / 3

if n < 0 or n != int(n):
    print(0)
elif m < 0 or m != int(m):
    print(0)
else:
    n = int(n)
    m = int(m)
    ans = comb(n+m, n)
    print(ans)
# Judge status: Accepted
S = input()

for a in '+-':
  for b in '+-':
    for c in '+-':
      ans = S[0] + a + S[1] + b + S[2] + c + S[3]
      if eval(ans) == 7:
        print(ans + '=7')
        exit()
# Judge status: Wrong Answer
n,k = map(int,input().split())
a_list = list(input().split())
dum = a_list[0]
ans_list = ""
for i in range(1,k+1):
    k = k - 1
    ans_list = ans_list+dum
    dum = a_list[int(dum)-1]
    if ans_list.count(dum) == 1:
        break
ind = ans_list.index(dum)
loop = ans_list[ind:]
len_loop = len(loop)
loop_after = (k)%len_loop
print(loop[loop_after-1])
# Judge status: Wrong Answer
n = int(input())
p = list(map(int, input().split()))

judge = 0
for i in range(n):
    if p[i] != i + 1:
        judge += 1
if judge >= 3:
    print('No')
else:
    print('Yes')
# Judge status: Accepted
N, K = map(int, input().split())
A = list(map(int, input().split()))

from math import ceil

print(ceil((N-1) / (K-1)))
# Judge status: Wrong Answer
n = int(input().strip())
count = 0
for i in range(n):
  a,b = map(int,input().strip().split())
  if a == b and count == 3:
    print('Yes')
    exit(0)
  elif a == b:
    count += 1
  elif(a != b):
    count = 0
print('No')
# Judge status: Accepted
X = int(input())
if X == 3 or X == 5 or X == 7:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
a,b=map(int,input().split())

c=int(str(a)+str(b))
if int(c**0.5)**2==c:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
num = list(input())
for i in range(2**3):
    n = []
    pm = ["+","+","+"]
    for j in range(3):
        if ((i >> j) & 1):
            pm[j] = "-"
    for k in range(3):
        n.append(num[k])
        n.append(pm[k])
    n.append(num[3])
    formula = ""
    for j in range(7):
        formula += n[j] 
    if eval(formula) == 7:
        [print(n[k],end="") for k in range(7)]
        print("=7")
        exit()
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
b = [0]
for i in range(n+1):
  b.append(b[-1]+a[-1-i])
b.reverse()
b.pop()
#print(a)
#print(b)
now = 1
ans = 0
for i in range(n+1):
  if now > b[i]:
    now = b[i]
  ans += now
  now -= a[i]
  if now <= 0 and i != n:
    print(-1)
    exit()
  if now < 0 and i == n:
    print(-1)
    exit()
  if now == 0 and i == n:
    print(ans)
    exit()
  now *= 2
  #print(i,now,ans)
# Judge status: Accepted
S = input()
n = len(S)
s = "hi" * (n // 2)

if n % 2 == 0 and s == S:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
A,B = map(int, input().split())

if A==1:
    A = 14
if B==1:
    B = 14


if A>B:
    print("Alice")
elif A<B:
    print("Bob")
else:
    print("Draw")
# Judge status: Accepted
s = input()
t = input()

if s==t[0:-1]:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
x = input("Enter a letter: ").lower()
print(chr(ord(x) + 1))
# Judge status: Wrong Answer
import sys
import logging
logging.basicConfig(level=logging.DEBUG)


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

i=0
while True:
   for j in str(N+i):
       #logging.debug('j={}'.format(j))
       if j in num:
           i+=1
           break
       else:
           print(N+i)
           sys.exit()
# Judge status: Accepted
import math
n,h=map(int,input().split())
a_max=0
b_=[]
for i in range(n):
    a,b=map(int,input().split())
    b_.append(b)
    if a_max<a:
        a_max=a
ans=0
b_=sorted(b_,reverse=True)
for i in range(n):
    if a_max<b_[i]:
        ans+=1
        h-=b_[i]
        if h<=0:
            h=0
            break
print(ans+math.ceil(h/a_max))
# Judge status: Wrong Answer
x, y = map(int,input().split())
z = x+y
print(z) if z < 25 else print(z-24)
# Judge status: Accepted
import math
n = int(input())
for i in range(n, 0, -1):
    if float.is_integer(math.sqrt(i)) == True:
        print(i)
        exit()
# Judge status: Accepted
N = int(input())
i = 1
while 1:
    if i * (i-1) // 2 < N and N <= i * (i+1) // 2:
        max_ans = i
        break
    else:
        i += 1
not_use = max_ans * (max_ans+1) // 2 - N
for i in range(1, max_ans+1, 1):
    if i != not_use:
        print(i)