Harryxun/stf_run huggingface dataset:
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 29 22:19:15 2020

@author: naoki
"""

N = int(input())

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

count1 = 0
count2 = 0
count = 10**9 +7
for i in A:
    count1+=i
	count1=count1%count
for j in A:
    count2 = j*(count1-j)%count + count2
    count1 = count1 -j 
    
print(count2%count)
    
    
    

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sat Aug 29 22:19:15 2020

@author: naoki
"""

N = int(input())

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

count1 = 0
count2 = 0
count = 10**9 +7
for i in A:
    count1+=i

for j in A:
    count2 = (j*(count1-j) + count2)%count
    count1 = count1 -j 
    
print(count2%count)
import copy as cp
N = int(input())
a = list(map(int, input().split()))

def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)

def gcd_all(a_list):
    gcd_num = gcd(a_list[0],a_list[1])
    for i in range(2, len(a_list)):
        gcd_num = gcd(gcd_num, a[i])
    return gcd_num

max_gcd = 0
for i in range(N):
    a_cp = cp.copy(a)
    del a_cp[i]
    max_gcd = max(max_gcd, gcd_all(a_cp))
print(max_gcd)

### FIXED CODE ###

#nn
from fractions import gcd 
n = int(input())
a = list(map(int, input().split()))
ans = 1
left = [0]
right = [0]

for i in range(n):
  left.append(gcd(left[-1], a[i]))
  right.append(gcd(right[-1], a[-(i+1)]))
right.reverse()

for i in range(n):
  ans = max(ans, gcd(left[i], right[i+1]))
print(ans)
a=input()
a.replace("/", "")
print("Heisei" if int(a)<=2019430 else "TBD")

### FIXED CODE ###

a=input()
print("Heisei" if int(a.replace("/", ""))<=20190430 else "TBD")
n, m = map(int, input().split())
A = sorted(map(int, input().split()))
BC = []
for j in range(m):
    b, c = map(int, input().split())
    BC.append((b, c))
BC = sorted(BC, key=lambda x: x[1], reverse=True)
for b, c in BC:
    i = bisect.bisect_left(A, c)
    if i == 0:
        break
    else:
        start = min(i, b)
        conect = [c for j in range(start)]
        A.extend(conect)
        A = A[start:]
print(sum(A))

### FIXED CODE ###

n, m = map(int, input().split())
A = sorted(map(int, input().split()))
BC = []
for j in range(m):
    b, c = map(int, input().split())
    BC.append((b, c))
BC = sorted(BC, key=lambda x: x[1], reverse=True)
D = []
for b, c in BC:
    D.extend([c for i in range(b)])
    if len(D) >= n:
        D = D[:n]
        break
for x in range(len(D)):
    if A[x] > D[x]:
        break
else:
    x += 1
print(sum(A[x:]) + sum(D[:x]))
a,b = map(int, input().split())
print(max([2*a-1, a+b, 2*b-1])

### FIXED CODE ###

a,b = map(int, input().split())
print(max([2*a-1, a+b, 2*b-1]))
a, b, c = input().split()
print(f'{c} {a} {b}')

### FIXED CODE ###

a, b, c = input().split()
print(c + ' ' + a + ' ' + b)
H, W  = map(int, input().split())

if H == 1 or W == 1:
    print(1)

else:
    print(((h*W) + 1) // 2)


### FIXED CODE ###

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

if H == 1 or W == 1:
    print(1)

else:
    print(((H*W) + 1) // 2)
H,W = map(int,input().split())
L = []
for i in range(H):
    L.append((input()))
for i in range(H):
    for j in range(W):
        if L[i][j] == "#":
            flag = False
            if i-1 >=0 and L[i-1][j] == "#":
                flag = True
            if i+1 <H and L[i+1][j] == "#":
                flag = True
            if j-1 >=0 and L[i][j-1] == "#":
                flag = True
            if j+1 <W and L[i][j+1] == "#":
                flag = True
            if flag == False:
                print("No")
                exit()
if flag:
    print("Yes") 

### FIXED CODE ###

H,W = map(int,input().split())
L = []
for i in range(H):
    L.append((input()))
for i in range(H):
    for j in range(W):
        if L[i][j] == "#":
            flag = False
            if i-1 >=0 and L[i-1][j] == "#":
                flag = True
            if i+1 <H and L[i+1][j] == "#":
                flag = True
            if j-1 >=0 and L[i][j-1] == "#":
                flag = True
            if j+1 <W and L[i][j+1] == "#":
                flag = True
            if flag == False:
                print("No")
                exit()
print("Yes")
A = input()
B = input()
C = B[:len(B) - 1]
if A == C:
  D = "Yes"
  else:
    D = "No"
print(D)

### FIXED CODE ###

A = input()
B = input()
C = B[:len(B)-1]
if A == C:
  D = "Yes"
else:
  D = "No"
print(D)
from collections import Counter
n=int(input())
s=input()
B=True
if s=='.'*n:
    B=False
if B:
    num=list(s).index('#')
    for i in range(n-1):
        if s[i:]=='#'*(n-i):
            A=True
            l=n-i
            break
    if num!=n-1:
        moji=s[num:]
        lst=dict(Counter(moji).items())
        a=lst['#'];b=lst['.']
        if a==0 or b==0:
            print(0)
        else:
            if A:
                print(min(a-l,b))
            else:
                print(min(a,b))
    else:
        print(0)
else:
    print(0)


### FIXED CODE ###

n=int(input())
s=input()
bres=0
wres=0
blst=[]
wlst=[]
for i in range(n):
    if s[i]=='#':
        bres+=1
    blst.append(bres)
for i in range(n-1,-1,-1):
    if s[i]=='.':
        wres+=1
    wlst.append(wres)
wlst=wlst[::-1]
ans=10**9
blst.insert(0,0)
wlst.insert(n,0)
for i in range(n+1):
    ans=min(blst[i]+wlst[i],ans)
print(ans)
a, b = map(int, input().split())
if a == b : print('Draw')
else :
  if min(a, b) == 1 : flag = True
  if a < b :
    if flag : print('Alice')
    else : print('Bob')
  else :
    if flag : print('Bob')
    else : print('Alice')


### FIXED CODE ###

a, b = map(int, input().split())
if a == b : print('Draw')
else :
  flag = False
  if min(a, b) == 1 : flag = True
  if a < b :
    if flag : print('Alice')
    else : print('Bob')
  else :
    if flag : print('Bob')
    else : print('Alice')
import sys
sys.setrecursionlimit(10**7)

def pow_k(x, n):
    if n == 0:
        return 1

    K = 1
    while n > 1:
        if n % 2 != 0:
            K *= x
        x *= x
        n //= 2

    return K * x

n = int(input())
x = list(input())

popcount = [0] * (10**6)
for i in range(10**6):
    popcount[i] = format(i, 'b').count('1')

counter = x.count('1')
number = int(''.join(x), 2)

def f(num, cnt):
    if num == 0:
        return cnt
    return f(num % popcount[num], cnt+1)

for i in range(n):    
    if x[i] == '0':
        m = number + pow_k(2, n-i-1)
        print(f(m % (counter+1), 1))
    if x[i] == '1':
        m = number - pow_k(2, n-i-1)
        print(f(m % (counter-1), 1))


### FIXED CODE ###

n = int(input())
x = list(input())

count = x.count('1')
one_count = count - 1
zero_count = count + 1

one_mod = 0
zero_mod = 0
for b in x:
    if one_count:
        one_mod = (one_mod * 2 + int(b)) % one_count
    zero_mod = (zero_mod * 2 + int(b)) % zero_count

f = [0] * 2000001
pop_count = [0] * 200001
for i in range(1, 200001):
    pop_count[i] = pop_count[i//2] + i % 2
    f[i] = f[i % pop_count[i]] + 1

for i in range(n):
    if x[i] == '1':
        if one_count:
            nxt = one_mod
            nxt -= pow(2, n-i-1, one_count)
            nxt %= one_count
            print(f[nxt] + 1)
        else:
            print(0)
    if x[i] == '0':
        nxt = zero_mod
        nxt += pow(2, n-i-1, zero_count)
        nxt %= zero_count
        print(f[nxt] + 1)
s, t = input().split()
a, b = int(input().split())
u = input()
if s == u:
  print(a-1, b)
else:
  print(a,b-1)


### FIXED CODE ###

s, t = input().split(' ')
a, b = map(int, input().split(' '))
u = input()

if u == s:
  print(a-1,b)
else:
  print(a,b-1)
if X<A:
  return 0
else:
  return10

### FIXED CODE ###

X, A = map(int, input().split())
 
if X<A:
  print(0)
else:
  print(10)
if A%C==0 and A%D==0:
    C_div = (B-A+1)//C + 1
else:
    C_div = (B-A+1)//C
if B%C==0 and B%D==0:
    D_div = (B-A+1)//D + 1
else:
    D_div = (B-A+1)//D
if A%(C*D) == 0 and B%(C*D) == 0:
    CD_div = (B-A+1)//(C*D) + 1
else:
    CD_div = (B-A+1)//(C*D)
if C == 1 or D == 1:
    print(0)
else:
    print((B-A+1) - C_div -D_div + CD_div))

### FIXED CODE ###

from fractions import gcd
A,B,C,D = map(int,input().split())
C_div = B//C - (A-1)//C
D_div = B//D - (A-1)//D
CD = (C * D) // gcd(C, D)
CD_div = B//CD - (A-1)//CD
print(B-A+1 - C_div - D_div + CD_div)
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>=577000000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

### FIXED CODE ###

X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y==576460752303423487:
  print(59)
  exit()
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)
import math
n = int(input())
t1 = int(input())
for _ in range(n-1):
    t2 = int(input())
    ans = t1*t2 // math.gcd(t1, t2)
    t1 = ans
print(ans)


### FIXED CODE ###

def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)


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

n = int(input())
t1 = int(input())
ans = t1
for _ in range(n-1):
    t2 = int(input())
    ans = lcm(ans, t2)
print(ans)
n,k=map(int,input().split())
h=list(map(int,input().split()))
dp=[10**5]*n
dp[0]=0
for i in range(2,n):
    dp[i]=min(dp[i-j]+abs(h[i-j]-h[i]) for j in range(1,k))
    print(dp[n-1])


### FIXED CODE ###

n,k=map(int,input().split())
h=list(map(int,input().split()))
dp=[10**5]*n
dp[0]=0
for i in range(1,n):
    dp[i]=min(dp[j]+abs(h[j]-h[i]) for j in range(max(0,i-k),i))
print(dp[n-1])
N,Q=map(int,input().split())
S=int(input())
l,r=[list(map(int,input().split())) for i in range(Q)]
for j in range(Q):
  print(str.count("AC",l[j].r[j]+1))

### FIXED CODE ###

N,Q=map(int,input().split())
S=input()
t=[0]*(N+1)
for i in range(N):
  t[i+1]=t[i]+(1 if S[i:i+2]=="AC" else 0)
for i in range(Q):
  l,r=map(int,input().split())
  print(t[r-1]-t[l-1])
import sys

n,m = map(int,input().split())
a = []
wk =[]
kai = 0
for i in range(m):
    wk = (list(map(int,input().split())))
    if wk in a:
        m -= 1
    else:
        a.append(wk)

a.sort()

if a[0][1] == 0:
        print('-1')
        sys.exit()
for i in range(m):
    if a[i][1]==n and a[i][1]==0:
        print('-1')
        sys.exit()
for i in range(m-1):
    if a[i][0] == a[i+1][0]:
        print('-1')
        sys.exit()

for i in range(m):
    kai += (10**(n-a[i][0]))*a[i][1]

print(kai)

### FIXED CODE ###

import sys

def ans(anl,n):
    an = 0
    for i in range(n):
        an += 10**(n-i-1)*anl[i]
    return(an)

n,m = map(int,input().split())
sc = [list(map(int,input().split())) for i in range(m)]

sc.sort(key=lambda x:x[0])
sc.sort()
anl =[0 for i in range(n)]
anl[0] = 1

if m == 0:
    if n == 1:
        print(0)
        sys.exit()
    else:
        print(10**(n-1))
        sys.exit()
if m == 1:
    if sc[0][1] == 0 and n == 1:
        print(0)
        sys.exit()
    anl[sc[0][0]-1] = sc[0][1]
    if anl[0] == 0:
        print('-1')
        sys.exit()
    print(ans(anl,n))
    sys.exit()

for i in range(m):
    for j in range(1,m):
        if sc[i][0] == sc[j][0] and sc[i][1]!=sc[j][1]:
            print('-1')
            sys.exit()
        else:
            anl[sc[i][0]-1] = sc[i][1]

if anl[0] == 0:
    print('-1')
    sys.exit()

print(ans(anl,n))
def C(A,B,C,X,Y):
    both_price=min(A+B,C*2)
    A_price=min(A,C*2)
    B_price=min(B,C*2)
 
    both_num=min(X,Y)
    X_num=X-both_num
    Y_num=Y-both_num
    return both_price*both_num+X_num*A_price+Y_num*B_price
 
inp = sys.stdin.read().split()
inp=[int(i) for i in inp]
print(C(inp[0], inp[1], inp[2],inp[3],inp[4],inp[5]))

### FIXED CODE ###

def parse_input(raw,format):
    raw=raw.split()
    format=format.split()

    ret={}
    rawpos=0
    for f in format:
        pass


def A(S):
    ret=700
    ret+=S.count("o")*100
    return ret

def B(N,X,m):
    ret=0
    X-=sum(m)
    ret+=len(m)

    ret+=int(X/min(m))

    return ret

def C(A,B,C,X,Y):
    both_price=min(A+B,C*2)
    A_price=min(A,C*2)
    B_price=min(B,C*2)

    both_num=min(X,Y)
    X_num=X-both_num
    Y_num=Y-both_num
    return both_price*both_num+X_num*A_price+Y_num*B_price

import sys

inp = sys.stdin.read().split()
inp=[int(i) for i in inp]
print(C(inp[0], inp[1], inp[2],inp[3],inp[4]))
N, K = map(int, input().split())
s = input()
  
group = []
sign = s[0]
curr = 0
for i in range(N):
  curr += 1
  if s[i] != sign: 
    group += [curr-1]
    curr = 1
    sign = s[i]
else:group += [curr]

if s[0] == '0':
  score = [sum(group[:2*K])]
  m = (len(group)+1)//2
  for i in range(m-K):
    score += [score[-1] - group[2*i] + group[2*i+2*K]]
else:
  score = [sum(group[:2*K+1])]
  m = len(group)//2
  for i in range(m-K):
    score += [score[-1] - group[2*i] - group[2*i+1] + group[2*i+2*K+1]+group[2*i+2*K +2]]

print(max(score))

### FIXED CODE ###

N, K = map(int, input().split())
s = input()
  
group = []
if s[0] == '0' :
  group = [0]
sign = s[0]
curr = 0
for i in range(N):
  curr += 1
  if s[i] != sign: 
    group += [curr-1]
    curr = 1
    sign = s[i]
else:group += [curr]
if s[-1] == '0':
  group += [0]

m = len(group)//2
if K >= m:
  print(N)
else:
  score = [sum(group[:2*K+1])]
  for i in range(m-K):
    score += [score[-1] - group[2*i]  - group[2*i+1] + group[2*i+2*K+1]+group[2*i+2*K+2]]
  
  print(max(score))
X=int(input())
if x>=30:
  print(Yes)
else:
  print(No)

### FIXED CODE ###

x=int(input())
if x>=30:
  print("Yes")
else:
  print("No")
Input = input().spilit()
Input[0] = int(Input[0])
Input[1] = int(Input[1])

i = 0

if Input[0] > Input[1]:
  print(str(Input[0])*Input[1])

elif Input[1] > Input[0]:
  print(str(Input[1])*Input[0])

else:
  print(str(Input[0])*Input[0])
  
  

### FIXED CODE ###

Input = input().split()
Input[0] = int(Input[0])
Input[1] = int(Input[1])
 
if Input[0] >= Input[1]:
  print(str(Input[1])*Input[0])
  
else:
  print(str(Input[0])*Input[1])
a = input()
b = input()
ans = sum(a[i] == b[i] for i in range(3))
print(ans)

### FIXED CODE ###

a, b = map(int, input().split())
print((b-2) // (a - 1) + 1)
import bisect
n = int(input())
a = list(map(int,input().split()))
t = [[] for _ in range(n+1)]
for _ in range(n-1):
    u,v = map(int,input().split())
    t[u].append(v)
    t[v].append(u)

INF = float('inf')
dp = [INF]*(n+1)
ans = [1]*(n+1)
checked = [False]*(n+1)
checked[1] = True
changes = []

def search(x):
    ind = bisect.bisect_left(dp,a[x-1])
    changes.append([ind,dp[ind]])
    dp[ind] = a[x-1]
    ans[x] = bisect.bisect_left(dp,INF)
    
    for i in t[x]:
        if not checked[i]:
            checked[i] = True
            search(i)
    
    b,c = changes.pop()
    dp[b] = c
    
search(1)
for i in a[1:]:
    print(i)

### FIXED CODE ###

import bisect
import sys
sys.setrecursionlimit(10**7)

n = int(input())
a = [0]+list(map(int,input().split()))
t = [[] for _ in range(n+1)]
for _ in range(n-1):
    u,v = map(int,input().split())
    t[u].append(v)
    t[v].append(u)

m = 10**18
dp = [m]*(n+1)
ans = [1]*(n+1)
checked = [False]*(n+1)
checked[1] = True
changes = []

def search(x):
    ind = bisect.bisect_left(dp,a[x])
    changes.append((ind,dp[ind]))
    dp[ind] = a[x]
    ans[x] = bisect.bisect_left(dp,m)
    
    for i in t[x]:
        if not checked[i]:
            checked[i] = True
            search(i)
    
    b,c = changes.pop()
    dp[b] = c
    
search(1)
for i in ans[1:]:
    print(i)
n = int(input())
l = list(map(int,input().split()))
ans = min(l)
if ans == 1:
    print(ans)
else:
    l_set = set(l)
    for i in range(n):
        for j in range(i,n):
            if l[i] % l[j] != 0 :
                l_set.add(l[i] % l[j] )
    l_set = sorted(list(l_set))
    print(min([l_set[i+1] - l_set[i] for i in range(len(l_set)-1)]))

### FIXED CODE ###

from fractions import gcd
from functools import reduce
n = int(input())
print(reduce(gcd,map(int,input().split())))
n,m,X = map(int,input().split())

C=[]
A=[]
for i in range(n):
	t = list(map(int, input().split()))
	C.append(t[0])#price of books
	A.append(t[1:])#point of books
	
result = -1 #結果の初期値
#N冊の本買う/買わない　を総当たり
for i in range(1<<n):#range(0,2**n)と同意
	t = [0] * m #理解度m個
	c = 0 #値段0
	#1-n冊目までをシフト演算
	for j in range(n):
		if (i>>j)&1:#購入している場合
			for k in range(m):
				t[k] += A[j][k]#各理解度をインプット
			c += C[j] #購入した本の値段を足していく
		else:
			pass
	if min(t)>=x:
		result==min(result, t)
if result == 10**9:
	print(-1)
else:
	print(result)

### FIXED CODE ###

n,m,x = map(int,input().split())

C=[]
A=[]
for i in range(n):
	t = list(map(int, input().split()))
	C.append(t[0])#price of books
	A.append(t[1:])#point of books
	
result = 10**9 #結果の初期値
#N冊の本買う/買わない　を総当たり
for i in range(1<<n):#range(0,2**n)と同意
	t = [0] * m #理解度m個
	c = 0 #値段0
	#1-n冊目までをシフト演算
	for j in range(n):
		if (i>>j)&1:#購入している場合
			for k in range(m):
				t[k] += A[j][k]#各理解度をインプット
			c += C[j] #購入した本の値段を足していく
		else:
			pass
	if min(t)>=x:
		result=min(result, c)
if result == 10**9:
	print(-1)
else:
	print(result)
import sys
import math
def Ii():return int(sys.stdin.readline())
def Mi():return map(int,sys.stdin.readline().split())
def Li():return list(map(int,sys.stdin.readline().split()))

s = sys.stdin.readline()
ans = 0
for i in s:
  ans += int(i)
  ans %= 9

print('Yes' if ans%9 == 0 else 'No')


### FIXED CODE ###

import sys
import math
def Ii():return int(sys.stdin.readline().rstrip())
def Mi():return map(int,sys.stdin.readline().split())
def Li():return list(map(int,sys.stdin.readline().split()))

s = sys.stdin.readline().rstrip()
ans = 0
for i in s:
	ans += int(i)
	ans %= 9

print('Yes' if ans%9 == 0 else 'No')
n,q=map(int,input().split())
d = {}
ans = [0]*(n+1)
for i in range(n-1):
    sta,gol = map(int,input().split())
    if sta not in d:
        d[sta] = set() 
    d[sta].add(gol)

dv = {}
for i in range(q):
    sta,val = map(int,input().split())
    if sta not in dv:
        dv[sta] = val 
    else:
        dv[sta]+=val
    

#print(d)
#print(dv)  

def cal_(ans_,sta_,flow):
    val_ = flow
    if sta_ in dv:
        val_ +=dv[sta_]
    
    ans_[sta_]+=val_
    
    if sta_ in d:
        targetset = d[sta_]
        for t in targetset:
            ans_=cal_(ans_,t,val_)
    return ans_

ans = cal_(ans,1,0)
    
for i in range(n):
    print(ans[i+1], " ",end="")

### FIXED CODE ###

n,q=map(int,input().split())
d = {}
ans = [0]*(n+1)
for i in range(n-1):
    sta,gol = map(int,input().split())
    d[gol] = sta

for i in range(q):
    sta,val = map(int,input().split())
    ans[sta]+=val
    

for i in range(n):
    gol = i+1
    if gol in d:
        ans[gol]+=ans[d[gol]]
    

for i in range(n):
    print(ans[i+1], " ",end="")
# coding:utf-8
n,m,q=map(int,input().split())
dp = [[0 for i in range(n)] for j in range(n)]
for i in range(m):
    l,r=map(int,input().split())
    l-=1
    r-=1
    dp[l][r]+=1
for i in range(n):
    for j in range(n-1):
        dp[i][j+1]+=dp[i][j]
for j in range(n):
    for i in range(n-1,0,-1):
        dp[i-1][j]+=dp[i][j]
print(dp)
for i in range(n):
    p,q=map(int,input().split())
    p-=1
    q-=1
    if q==n-1:
        print(dp[p][q])
    else :
     print(dp[p][q]-dp[q][q])


### FIXED CODE ###

# coding:utf-8
n,m,qq=map(int,input().split())
dp = [[0 for i in range(n+5)] for j in range(n+5)]
for i in range(m):
    l,r=map(int,input().split())
    l-=1
    r-=1
    dp[l][r]+=1
for i in range(n):
    for j in range(n-1):
        dp[i][j+1]+=dp[i][j]
for j in range(n):
    for i in range(n-1,0,-1):
        dp[i-1][j]+=dp[i][j]
for i in range(qq):
    p,q=map(int,input().split())
    p-=1
    q-=1
    if q==n-1:
        print(dp[p][q])
    else :
     print(dp[p][q]-dp[q+1][q])
def get_int(s, si, ei=None):
    #print(f'get_int: s={s}, si={si}, ei={ei}')
    if ei is None:
        value = int(s[si:])
    else:
        value =  int(s[si:ei])
    #print(f'value={value}')
    return value


BIT = 1

str_s = input()
s = int(str_s)
slen = len(str_s)

result = 0
for i in range(2 ** (slen - 1) ):
    #print(f'======= i={bin(i)} ========')
    s_index = 0
    for k in range(slen - 1):
        bit = (i >> k) & BIT        
        if bit == 0:
            continue
        e_index = k + 1
        value = get_int(str_s, s_index, e_index)
        result += value
        s_index = e_index
    value = get_int(str_s, s_index)
    result += value

print(result)


### FIXED CODE ###

import re

s = input()
t = input()

def check(s, t):
    p = re.compile('[a-z]+')
    if not p.match(s) or not p.match(t):
        return 'No'
    if len(s) < 1 or len(s) > 10:
        return 'No'
    if len(s) + 1 != len(t):
        return 'No'
    if t[0:len(s)] != s:
        return 'No'
    return 'Yes'

print(check(s, t))
# ABC139
from math import ceil
def main():
    A, B = tuple(map(int, input().split()))
    if A >= B:
        print(1)
    else:
        ans = 1 + ceil((B - A) / (A - 1))
        print(ans)


if __name__ == "__main__":
    main()

### FIXED CODE ###

# ABC139
def main():
    N, *H = map(int, open(0).read().split())
    ans, cur, cnt = 0, H[0], 0
    for i in H[1:]:
        if i <= cur:
            cnt += 1
        else:
            ans = max(ans, cnt)
            cnt = 0
        cur = i
    ans = max(ans, cnt)
    print(ans)


if __name__ == "__main__":
    main()
n = int(input())
p = list(map(int, input().split()))
k = int(input())
s = sum(p)
for i in range(k):
  a, b = map(int, input().split())
  print(s - p[a-1] + b)


### FIXED CODE ###

a, op, b = input().split()
a = int(a)
b = int(b)
if op == "+":
  print(a + b)
else:
  print(a - b)
n = int(input())

s = input()

alphabet = ["A","B","C","D","E","F","G","H","I","J","K","L","M","M","O","P","Q","R","S","T","U","V","W","X","Y","Z"]

ans = ""
for i in range(len(s)):
    num = ( alphabet.index(s[i]) + n ) % len(alphabet)
    ans += alphabet[num]
    
print(ans)

### FIXED CODE ###

n = int(input())
 
s = input()
 
alphabet = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
 
ans = ""
for i in range(len(s)):
    num = (alphabet.index(s[i]) + n) % len(alphabet)
    ans += alphabet[num]
    
print(ans)
from collections import Counter
n=int(input())
a=list(map(int,input().split()))
c=Counter(a)
c=list(c)
ans=0
for k in range(len(c)):
  i=c[k][0]
  x=c[k][1]
  if i>x:
    ans+=x
  elif i<x:
    ans+=x-i
print(ans)

### FIXED CODE ###

from collections import Counter
n=int(input())
a=list(map(int,input().split()))
c=Counter(a)
c=list(c.items())
ans=0
for k in range(len(c)):
  i=c[k][0]
  x=c[k][1]
  if i>x:
    ans+=x
  elif i<x:
    ans+=x-i
print(ans)
import sys
input = sys.stdin.readline

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

b = [0] * 40 # ビットごとの1の個数

for i in a:
    bin_i = format(i, 'b')
    bin_i = bin_i[::-1]
    for j in range(len(bin_i)):
        if bin_i[j] == "1":
            b[j + 1] += 1

x = []
for i in b[1:]:
    if n - i <= i:
        x.append("0")
    elif n - i > i:
        x.append("1")
x = x[::-1]
i = 0
while int("".join(x), 2) > k:
    x[i] = "0"
    i += 1
x = int("".join(x), 2)

ans = 0

for i in a:
    ans += i ^ x

print(ans)

    

### FIXED CODE ###

import sys
input = sys.stdin.readline

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

bin_k = format(k, 'b').zfill(50)

b = [0] * 50 # ビットごとの1の個数

for i in a:
    bin_i = format(i, 'b').zfill(50)
    for j in range(len(bin_i)):
        if bin_i[j] == "1":
            b[j] += 1

dp = [[0, 0] for _ in range(len(bin_k))]

if bin_k[0] == "0":
    dp[0][0] = b[0] * 2**(len(bin_k) - 1) # 0
else:
    dp[0][0] = (n - b[0]) * 2**(len(bin_k) - 1) # 1
    dp[0][1] = b[0] * 2**(len(bin_k) - 1) # 0

for i in range(1, len(bin_k)):
    if bin_k[i] == "0":
        dp[i][0] = dp[i - 1][0] + b[i] * 2**(len(bin_k) - (i + 1))
        if dp[i - 1][1] > 0:
            dp[i][1] = max(dp[i - 1][1] + b[i] * 2**(len(bin_k) - (i + 1)), dp[i - 1][1] + (n - b[i]) * 2**(len(bin_k) - (i + 1)))
    else:
        dp[i][0] = dp[i - 1][0] + (n - b[i]) * 2**(len(bin_i) - (i + 1))
        dp[i][1] = dp[i - 1][0] + b[i] * 2**(len(bin_k) - (i + 1))
        if dp[i - 1][1] > 0:
            dp[i][1] = max(dp[i][1], dp[i - 1][1] + (n - b[i]) * 2**(len(bin_i) - (i + 1)), dp[i - 1][1] + b[i] * 2**(len(bin_k) - (i + 1))) 

print(max(dp[-1][0], dp[-1][1]))
A = ['1','1','1','2','1','2','1','5','2','2','1','5','1','2','1','14','1','5','1','5','2','2','1','15','2','2','5','4','1','4','1','51']
i = input()
print(A[i])

### FIXED CODE ###

A = ['1','1','1','2','1','2','1','5','2','2','1','5','1','2','1','14','1','5','1','5','2','2','1','15','2','2','5','4','1','4','1','51']
i = int(input())
print(A[i-1])