peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n = int(input())
print('Yes' if sum(i*j == n for i in range(1, 10) for j in range(1, 10)) else 'No')
# Judge status: Wrong Answer
x = int(input())

k = 4
if x <= 90:
    k = 360/x
else:
    k = 360/ (180-x)

k = int(k)
print(k)
# Judge status: Accepted
N=int(input())
ans=0
for i in range(5):
    ans+=1
    a=int(input())
    if N%a==0:
        A=int(N//a)
    else:
        A=int(N//a)+1
    ans=max(ans,A+i)
print(ans)
# Judge status: Accepted
A, B = map(int, input().split())

if B >= A:
    print(A)
else:
    print(A-1)
# Judge status: Wrong Answer
s=input()
n=len(s)
if n<=1:
  print("No")
  exit()
if s=="hi":
  print("Yes")
  exit()
for i in range(n-1):
  if s[i]=="h" and s[i+1]=="i":
    if i==0 and s[i+2]!="i":
      print("Yes")
      exit()
    if i==n-1 and s[i-1]!="h":
      print("Yes")
      exit()
    if s[i-1]!="h" and s[i+2]!="i":
      print("Yes")
      exit()
print("No")
# Judge status: Wrong Answer
n = int(input())

works = list()
for num in range(n):
    a = list(map(int, input().split()))
    works.append(a)

works.sort(key = lambda x :x[1])

time = 0

counter = 0

for row in works:
    time += row[0]
    counter += 1
    if time >= row[1]:
        print("No")
        exit()

print("Yes")
# Judge status: Wrong Answer
Sp = input()
Sp_list = list(Sp)
N = len(Sp)
T = input()
n = len(T)

def check(s, t):
  for si, ti in zip(s, t):
    if si == '?':
      continue
    if si != ti:
      return False
  return True

ans = []
for i in range(N-n+1):
  if check(Sp[i:i+n], T):
    Sp_list[i:i+n] = list(T)
    ans.append(''.join(Sp_list).replace('?', 'a'))

if ans:
  ans.sort()
  print(ans[0])
else:
  print('UNRESTORABLE')
# Judge status: Accepted
n = int(input())
m = n%1000
if m ==0:
    print(0)
else :
    print(1000-m)
# Judge status: Accepted
a, b=map(int, input().split())

if (a*b)%2==0:
	print('Even')
else:
    print('Odd')
# Judge status: Wrong Answer
n,m = map(int,input().split())

C={}
S=[]
for i in range(n):
    a,b = map(int,input().split())
    S.append(a)
    C[a]=b
S.sort()

ans=0
for s in S:
    # print(S,C,ans)
    if m<C[s] :
        ans+=m*s
        break
    else:
        ans+=C[s]*s
        m-=C[s]

print(ans)
# Judge status: Accepted
N = int(input())
out = 0
for i in range(1,N):
    c = (N-1) // i
    out += c
print(out)
# Judge status: Accepted
x = int(input())
n = 0
y = 100
while x > y:
  y = int(y*1.01)
  n = n + 1

print(n)
# Judge status: Wrong Answer
x = int(input())

l = [7, 5, 3]

if x in l:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N, W = map(int, input().split())
w = []
v = []
for n in range(N):
    w1, v1 = map(int, input().split())
    w.append(w1)
    v.append(v1)

memo = [[0 for i in range(W+1)] for j  in range(N+1)]
def into(num, weight):
    if num >= N:
        return 0
    if weight < w[num]:
        return 0
    if memo[num][weight] != 0:
        return memo[num][weight]
    c= max( into(num+1, weight-w[num])+v[num], into(num+1, weight) )
    memo[num][weight] = c
    return c
print(into(0, W))
# Judge status: Accepted
n = int(input())
sum = n*(n+1)//2
print(sum-n)
# Judge status: Wrong Answer
n, k, s = map(int, input().split())

for i in range(1, n+1):
    if i <= k+1:
        if s %2 == 1 and i % 2 == 1:
            print(s//2 + 1)
        else:
            if i == k:
                print(s//2 + 1)
            print(s//2)
    else:
        if k//2 == s//2 + 7:
            print(s//2 + 1)
        else:

            print(s//2+7)
# Judge status: Wrong Answer
k = int(input())

def check(i):
  s = str(i)
  flag = True
  for j in range(len(s)-1):
    if (abs(int(s[j])-int(s[j+1])) >= 2):
      flag = False
  return flag

cnt = 0
for i in range(1, 200000):
  if (len(str(i)) == 1):
    cnt += 1
  elif(check(i)):
    cnt += 1

  if (cnt == k):
    print(i)
    break
# Judge status: Accepted
from math import sqrt, ceil
n = int(input())
ans = 0
for i in range(1, n+1, 2):
    score = 0
    for d in range(1, ceil(sqrt(i))+1):
        p, m = divmod(i, d)
        if m == 0:
            if p != d:
                score += 2
            else:
                score += 1
    if score == 8:
        ans += 1
print(ans)
# Judge status: Wrong Answer

import math
import collections


def main():
  N = int(input())
  S = [input() for _ in range(N)]
  
  A = collections.Counter(S)
  
  
  print('AC × ' + str(A['AC']))
  print('WA × ' + str(A['WA']))
  print('TLE × ' + str(A['TLE']))
  print('RE × ' + str(A['RE']))
  
  
  
main()
# Judge status: Accepted
A,B,K = map(int,input().split())
if B-A+1 <= K*2:
    for i in range(A,B+1):
        print(i)
else:
    for i in range(A,A+K):
        print(i)
    for i in range(B-K+1,B+1):
        print(i)
# Judge status: Accepted
r,g,b = map(str,input().split())
value = r+g+b

if int(value)%4 == 0:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
s = list(map(int,input().split(' ')))
print("Yes") if s[0] == s[1] else print('No')
# Judge status: Wrong Answer
n,m = map(int, input().split())
py = [list(map(int, input().split())) for _ in range(m)]
py.sort()

ans = []
b = py[0][0]
cnt = 0
for p,y in py:
  if b == p: cnt += 1
  else:
    b = p
    cnt = 1
  a = [str(p), str(cnt)]
  if len(str(p)) < 6: a[0] = "0"*(6-len(str(p))) + str(p)
  if len(str(cnt)) < 6: a[1] = "0"*(6-len(str(cnt))) + str(cnt)
  ans.append(a[0] + a[1])
for v in ans: print(v)
# Judge status: Wrong Answer
import sys
input=sys.stdin.readline

N,K=(int(x) for x in input().rstrip('\n').split())
L = list(input())
sta = L[0]
change=0
now = sta
for x in L[1:]:
  if x!=now:
    now = x
    change += 1
res = change - K*2
if res < 0:
  res = 0
print(N-1-res)
# Judge status: Accepted
from collections import Counter
def main():
    n=int(input())
    s=input()
    d=Counter(s)
    a=d["R"]*d["G"]*d["B"]
    for i in range(n):
        t=min(n-i-1, i)
        for j in range(t+1):
            if s[i-j] != s[i] and s[i-j] != s[i+j] and s[i] != s[i+j]:
                a-=1
    print(a)
    
if __name__ == "__main__":
    main()
# Judge status: Accepted
# 155 B

n = int(input())
s = list(map(int, input().split()))
valid = True

for i in s:
    if i % 2 == 0:
        if i % 3 != 0 and i % 5 != 0:
            valid = False

if valid == True:
    print("APPROVED")
elif valid == False:
    print("DENIED")
# Judge status: Accepted
A = int(input())
B = int(input())
C = int(input())
X = int(input())
n = X // 500 + 1
count = 0
for i in range(n):
  if i <= A:
    m = (X-500*i)//100+1
    for j in range(m):
      if j <= B and (X-500*i - 100*j) % 50 == 0 and ((X-500*i - 100*j) / 50) <= C:
        if not (i==0 and j ==0 and ((X-500*i - 100*j) / 50)==0): 
          count += 1

print(count)
# Judge status: Accepted
X, Y = map(int, input().split())
fin = ""
if (X * 4 < Y or X * 2 > Y or Y % 2 != 0):
	fin += "No"
else:
	fin += "Yes"
print(fin)
# Judge status: Wrong Answer
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())


dishes = [A, B, C, D, E]
tens = 0
ones = 9
muda = 10
for d in dishes:
    if d % 10 == 0:
        tens += d // 10
    else:
        tens += d // 10 + 1
        if d % 10 < ones:
            muda = d
            ones = d % 10

#%%
if muda % 10 == 0:
    ans = tens * 10
else:
    ans = tens * 10 - (10 - muda % 10)
print(ans)
# Judge status: Accepted
N,A,B= map(int,input().split())
S=input()
sanka=0
kaigai=0

for i in range(N):
  if S[i]=="a":
    if sanka< A+B:
      print("Yes")
      sanka += 1
    else:
      print("No")
  elif S[i]=="b":
    if sanka < A+B and kaigai <B:
      print("Yes")
      sanka += 1
      kaigai += 1
    else:
      print("No")    
  else:
    print("No")
# Judge status: Accepted
N = int(input())
A_list = [int(item) for item in input().split()]

all_sum = sum(A_list)

F_sum_list = [A_list[0]]

for j in range(1,N):
    F_sum_list.append(F_sum_list[-1] + A_list[j])

delta_list = [abs(all_sum - 2* i) for i in F_sum_list]

print(min(delta_list))
# Judge status: Accepted
n, c, k = map(int, input().split())
t = []
for i in range(n):
    t.append(int(input()))
t.sort()
ans = 0
counter = 0
lim = t[0]
for i in range(n):
    if counter < c and (t[i] - lim) <= k:
        counter += 1
    else:
        counter = 1
        lim = t[i]
        ans += 1
print(ans + 1)
# Judge status: Wrong Answer
n, m = map(int, input().split())
if n == 1 and m == 1:
    ans = 0
elif n == 1:
    ans = m - 2
elif m == 1:
    ans = n - 2
else:
    ans = (n - 2) * (m - 2)
print(ans)
# Judge status: Wrong Answer
n,m=map(int,input().split())
a=[]
b=[]
for i in range(n):
    a.append(list(input()))
for i in range(m):
    b.append(list(input()))
for i in range(n-m):
    for j in range(n-m):
        flg=True
        for k in range(m):
            for kk in range(m):
                if b[k][kk]!=a[i+k][j+kk]:
                    flg=False
        if flg:
            print("Yes")
            exit()
print("No")
# Judge status: Accepted
n = int(input())
A = [0]+list(map(int,input().split()))
ans = 0
for i in range(1,n+1):
    d = A[i-1] -A[i]
    if(d >0):
        A[i] += d 
        ans += d
        
print(ans)
# Judge status: Wrong Answer
N = int(input())
L = list(map(int, input().split()))

money = 1000
stocks = 0

for i in range (0, N-1):
    if L[i+1] > L[i]:
        stocks = money//L[i]
        money = money%L[i]
    elif L[i+1] == L[i]:
        continue
    else:
        money+= stocks*L[i]
        stocks = 0

print(money+stocks*L[-1])
# Judge status: Accepted
xkd = input().split()
X = int(xkd[0])
K = int(xkd[1])
D = int(xkd[2])

X = abs(X)
ans = 0
times = int(X/D)
oneMore = False
if X%D > abs(D-X%D):
    times+=1

if times > K:
    ans = X - (D*K)
else:
    if (times%2) == (K%2):
        ans = min(X%D, (D-X%D))
    else:
        ans = max(X%D, (D-X%D))

print(ans)
# Judge status: Accepted
n = int(input())
ans = 1
for i in range(2, 10**5):
    if i*i <= n:
        ans = i*i
print(ans)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))

dp=[[0 for i in range(2)] for i in range(n+1)]
dp[0][0]=0
dp[0][1]=-10**9+1

for i in range(0,n):
    dp[i+1][0]=max(dp[i][0]+a[i] , dp[i][1]-a[i])
    dp[i+1][1]=max(dp[i][0]-a[i] , dp[i][1]+a[i])

print(dp[n][0])
#解説AC
# Judge status: Accepted
N = int(input())
ab = [list(map(int, input().split())) for i in range(N)]

al = []
bl = []
for a,b in ab:
  al.append(a)
  bl.append(b)
al.sort()
bl.sort()

if N%2 == 0:
  ans = (bl[N//2] + bl[N//2 -1]) - (al[N//2] + al[N//2 -1]) +1
else:
  ans = bl[N//2] - al[N//2] +1
print(ans)
# Judge status: Wrong Answer
import sys
sys.setrecursionlimit(10000)

x,y = map(int,input().split())

asn = 0
def dfs(x,y,n):
    
    n += 1
    ans = x*2**n
    if ans > y:
        return n
    else:
        return dfs(x,y,n)

a = dfs(x,y,1)

print(a)
# Judge status: Accepted
a, b = map(int, input().split())
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

print(len(set(prime_factorize(a)).intersection(set(prime_factorize(b))))+1)
# Judge status: Accepted
X, Y = map(int, input().split())
print(-1 if X % Y == 0 else X)
# Judge status: Accepted
N=int(input())
ls=[[0]*9 for _ in range(9)]
for i in range(1,N+1):
  a=i
  while a//10!=0:
    a//=10
  b=i%10
  if b!=0:
    ls[a-1][b-1]+=1 
ans=0    
for i in range(1,10):
  for j in range(1,10):
    ans+=ls[i-1][j-1]*ls[j-1][i-1]
print(ans)
# Judge status: Accepted
x=int(input())
ans=1
now=x
while now%360!=0:
    now+=x
    ans+=1
print(ans)
# Judge status: Accepted
S = input()

if S == "RRR":
    print(3)
elif S == "RRS":
    print(2)
elif S == "SRR":
    print(2)
elif S == "RSR":
    print(1)
elif S == "SRS":
    print(1)
elif S == "RSS":
    print(1)
elif S == "SSR":
    print(1)
else:
    print(0)
# Judge status: Wrong Answer
N,T=map(int,input().split())

CT=[[0,0]]*N
i=0
while i<N:
    CT[i]=list(map(int,input().split()))
    i+=1

CT=sorted(CT)

print(CT)

ans='TLE'
for x,y in CT:
    if y<=T:
        ans=x
        break
print(ans)
# Judge status: Wrong Answer
def main():
  S=input()
  if ord(S)<=65:
  	print(chr(ord(S)+32))
  else:
    print(chr(ord(S)-32))

main()
# Judge status: Accepted
import bisect
from math import ceil

N,H,*abf = map(int, open(0).read().split())
ab = [abf[i:i+2] for i in range(0, len(abf), 2)]
a = sorted([x[0] for x in ab],reverse=True)
b = sorted([x[1] for x in ab],reverse=True)
br = list(reversed(b))
bs = bisect.bisect_right(br,a[0])
ans = 0
rem = H
for i in range(N-bs):
    rem -= b[i] 
    ans += 1
    if rem <= 0:
        print(ans)
        break
else:
    ans += ceil(rem/a[0])
    print(ans)
# Judge status: Accepted
n=int(input())
p=[int(x) for x in input().split()]


cnt=0
for i in range(n-1):
  if i+1 == p[i]:
    cnt+=1
    p[i+1]=p[i]
  else:
    mae=p[i]

if p[n-1]==n:
  print(cnt+1)
else:
  print(cnt)
# Judge status: Wrong Answer
N, K = input().split()
H = input().split()

H.sort()
N = int(N)
K = int(K)
sum = 0
if(N - K <= 0):
  	sum = 0
else:
	for i in range(N):
	  if(i < N - K):
	    	sum += int(H[i])

print(sum)
# Judge status: Accepted
n = int(input())
s = input()
if n%2 == 1:
    print('No')
else:
    s1, s2 = s[:n//2], s[n//2:]
    if s1 == s2:
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
sx,sy,tx,ty = map(int, input().split())
y1=ty-sy
x1=tx-sx
a = "U"*y1+"R"*x1+"D"*y1+"L"*x1+"L"+"U"*(y1+1)+"R"*(x1+1)+"D"+"R"+"D"*(y1+1)+"L"*(x1+1)+"U"
print(a)
# Judge status: Accepted
from collections import Counter

n = int(input())
s = [input() for i in range(n)]

d = Counter(s)
m = max(d.values())
ans = [i for i in d if d[i] == m]
ans = sorted(ans)

for i in ans:
    print(i)
# Judge status: Accepted
from collections import defaultdict

n = int(input())
ss = [input().strip() for _ in range(n)]

counts = defaultdict(int)

for s in ss:
    counts[s] += 1

items = list(counts.items())
items = sorted(items, key=lambda c: c[1], reverse=True)

max_value = items[0][1]
max_items = [item for item in items if item[1] == max_value]

keys = [item[0] for item in max_items]
keys = sorted(keys)

for key in keys:
    print(key)
# Judge status: Accepted
n = int(input())
P = [[0, 0, 0]]
f = True
for i in range(n):
    t, x, y = map(int, input().split())
    s = abs(x - P[i][1]) + abs(y-P[i][2])
    if s > t-P[i][0] or (t-P[i][0] - s)%2 == 1:
        f = False
    P.append([t, x, y])
if f: print("Yes")
else: print("No")
# Judge status: Accepted
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  #空白なし
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  #空白あり
def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし

X = I()

from math import gcd

print(360//gcd(360,X))
# Judge status: Wrong Answer
x = ord(input())
ind = (x - ord("A")+1)%26
print(chr(ind+ord("A")))
# Judge status: Accepted
N,A,B = map(int, input().split())
if (B-A)%2==0:
  print((B-A)//2)
else:
  print(min(A-1,N-B)+1+(B-A-1)//2)
# Judge status: Accepted
A, B, K = map(int, input().split())
result = []
num = A if A > B else B
for i in range(1, num+1):
  if A % i == 0 and B % i == 0:
    result.append(i)
result.sort(reverse=True)
print(result[K-1])
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
if a+b==c or a+c==b or b+c==a:
  print("YES")
else:
  print("NO")
# Judge status: Wrong Answer
X, Y = map(int, input().split())

cnt = 1
calc = X

while calc <= Y:
    cnt += 1
    calc = X*(2**cnt)

print(cnt)
# Judge status: Accepted
S=input()
if len(S) == len(set(S)):
    print("yes")
else:
    print("no")
# Judge status: Accepted
a,b=map(int, input().split())
ans=1
if a <= 0 and b >= 0:
  print('Zero')
  exit(0)
if a>0 and b > 0:
  print('Positive')
  exit(0)
if a <0 and b<0:
  d=abs(b-a)+1
  if d %2==0:
    print('Positive')
    exit(0)
  else:
    print('Negative')
    exit(0)
# Judge status: Accepted
import sys

data = sys.stdin.readlines()

n, k = list(map(int, data[0].split()))
h = list(map(int, data[1].split()))

dp = [-1] * n
dp[0] = 0

for i in range(1, min(n, k)):
    dp[i] = min([dp[j] + abs(h[i]-h[j]) for j in range(i)])

for i in range(k, n):
    dp[i] = min([dp[i-j] + abs(h[i]-h[i-j]) for j in range(1, k+1)])

print(dp[n-1])
# Judge status: Accepted
N = int(input())

if (N%10 == 0):
    print(10)
    exit()
a = []
while N > 0:
    a.append(N%10)
    N //= 10

print(sum(a))
# Judge status: Wrong Answer
n,k = map(int,input().split())
a = list(map(int,input().split()))

for x in range(k-1):
  b = [0]*n
  
  for x in range(n-1):
    
    if a[x] != 0:
    
      add = [1]*(a[x]*2+1)
      b = [x + y for (x, y) in zip(a, b)]
    
  a = [x + y for (x, y) in zip(a, b)]

print(a)
# Judge status: Accepted
S=input()
K=int(input())
for i in range(min(len(S),K)):
  if S[i]>="2":
    print(S[i])
    exit()
print("1")
# Judge status: Accepted
# -*- coding: utf-8 -*-

s = input().strip()

W_dic={ w:0 for w in s }

for w in s:
    W_dic[w] += 1

for v in W_dic.values():
    if v % 2 != 0:
        print("No")
        break
else:
    print("Yes")
# Judge status: Accepted
s = input()
min_ = 10**18
for i in range(len(s)-2):
  min_ = min(min_, abs(753 - int(s[i:i+3])))

print(min_)
# Judge status: Accepted
N=int(input())
l=list(map(int,input().split()))
A=max(l)
mid=(A//2)+1 if A%2!=0 else A//2
dis_min=float("Inf")
l.sort()
ans=1
for i in l:
   if dis_min>abs(i-mid):
      dis_min=abs(i-mid)
      ans=i
print(A,ans)
# Judge status: Wrong Answer
a, b = map(int, input().split())

if 1<a<10 and 1<b<10:
  print(a*b)
else:
  print(-1)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))

for i in range(1,N):
    A[i] += A[i-1]

diff_min = 10**16

for i in range(N):
    diff_min = min(diff_min,abs(A[N-1]-2*A[i]))

print(diff_min)
# Judge status: Accepted
n = int(input())
w = list(map(int, input().split()))
center = sum(w)//2
sml = 0
i = 0
while sml < center:
    sml += w[i]
    i += 1
i -= 1
smr = sum(w)-sml
if sml-smr > smr+w[i]-(sml-w[i]):
    print(smr+w[i]-(sml-w[i]))
else:
    print(sml-smr)
# Judge status: Wrong Answer
s=input()
a=[]
n=0
for i in s:
    a.append(i)
result='Good'
while n<=3:
    if a[n]==a[n-1]:
        result='Bad'
    n+=1
print(result)
# Judge status: Accepted
import sys
import math

s=input()
k = int(input())
cnt = False
ans=0
for i in range(0,k):
    if s[i] != '1':
        ans = s[i]
        cnt = True
        break
if (not cnt):
    print(1)
else:
    print(ans)
# Judge status: Wrong Answer
import math
x, y = list(map(int, input().split()))
ans = int(math.log2(y//x)) + 1
print(ans)
# Judge status: Accepted
n, m = [int(x) for x in input().split(' ')]

cities = list()
for i in range(m):
    pi, pm = [int(x) for x in input().split(' ')]
    cities.append([pi, pm, i])

p = [0] * (n+1)
for c in sorted(cities, key=lambda city: city[1]): # sort by year
    p[c[0]] += 1 # city birth order
    c.append(p[c[0]])

for c in cities:
    print('{:06d}{:06d}'.format(c[0], c[3]))
# Judge status: Accepted
N, K = list(map(int, input().split()))
H = list(map(int, input().split()))

def calCount(h):
    if K > N:
        return 0
    return sum(h[K:])

H.sort(reverse=True)
print(calCount(H))
# Judge status: Wrong Answer
import copy

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

A_max=max(A)
M=[i for i,x in enumerate(A) if x==A_max]

if len(M)>=2:
    for i in range(N):
        print(A_max)
else:
    for j in range(N):
        if j!=M[0]:
            print(A_max)
        else:
            B=copy.copy(A)
            B.remove(A_max)
            print(max(B))
# Judge status: Accepted
a = ['D' if i == '?' else i for i in input()]
print("".join(a))
# Judge status: Accepted
n,k = map(int,input().split())

A = list(map(int,input().split()))
t = 0
c = 0
ans = [0] * n
L = []
s = 0
for _ in range(k):
    if ans[t] == 1:
        n = len(L) - L.index(t)
        temp = (k-c)%n
        t = L[L.index(t):][temp]
        break
    else:
        ans[t] = 1
        L.append(t)
        t = A[t]-1
        c += 1
print(t+1)
# Judge status: Accepted
from collections import deque
d = deque()
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
    if i % 2 == 0:
        d.append(a[i])
    else:
        d.appendleft(a[i])

if n % 2 == 1:
    d.reverse()

for i in d:
    print(i)
# Judge status: Wrong Answer
S=(input())
s=list(S)
K=int(input())
if K==1:
  print(s[0])
  exit()
for i in range(len(s)):
  key=s[i]
  if key!='1':
    print(key)
    exit()
# Judge status: Wrong Answer
s=str(input())
s=list(s)
for i in range(0,len(s)):
  temp=s.count(s[i])
  if temp!=1:
    print("no")
else:
  print("yes")
# Judge status: Wrong Answer
s=input()
import re
#re.match は複数を対象にすればマッチする該当のものが返される。一つの時ifの後に持ってくると条件式として利用可能。
if re.match("(dream|dreamer|erase|eraser)+",s) :
       print("YES")
else:
       print("NO")
# Judge status: Accepted
N = int(input())
S = input()
r = S.count("R")
g = S.count("G")
b = S.count("B")
ans = r * g * b
for i in range(N-2):
    t = 1
    while i + 2 * t < N:
        if(S[i] != S[i+t] and S[i] != S[i+2*t] and S[i+t] != S[i+2*t]):
            ans -= 1
        t += 1
print(ans)
# Judge status: Accepted
n = int(input())
lis = [list(map(int,input().split())) for _ in range(n)]

cnt = 0
flg = 0

for i in lis:
    if i[0]==i[1]:
        cnt += 1
        if cnt >= 3:
            flg = 1
    else:
        cnt = 0

if flg == 1:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
D,T,S=map(int, input().split())
if S*T >= D:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n, x = map(int, input().split())
a = list(map(int, input().split()))
c = 0
if a[0] > x:
    c += a[0] - x
    a[0] = x
for i in range(1, n):
    if a[i - 1] + a[i] > x:
        c += a[i - 1] + a[i] - x
        a[i] = x - a[i - 1]
print(c)
# Judge status: Accepted
N, M = map(int, input().split())
if N == 1 and M == 1:
    print(1)
elif N == 1 or M == 1:
    print(max(N, M) - 2)
else:
    print((N - 2) * (M - 2))
# Judge status: Accepted
n  = int(input()) - 1

def f(n):
    p = 0
    ans=[]
    while True:
        if n >= 26**(p+1):
            n -=26**(p+1)
            p+=1
        else:
            for i in range(p+1):
                ans.append( chr( ord('a') + n%26 ) )
                n //= 26
            break
    print(''.join(reversed(ans)))

f(n)
# Judge status: Wrong Answer
def main():
    min_num = len(T)
    for i in range(len(S)):
        count = 0
        for j in range(len(T)):
            if i+j > len(S)-1:
                break
            if S[i+j] == T[j]:
                count += 1
        min_num = min_num if min_num < len(T)-count else len(T)-count
    print(min_num)

S = input()
T = input()
main()
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
a.sort()
l = [True] * (10**6 + 1)
cnt = 0
for i in range(n):
  d = a[i]
  if l[d]:
    if i < n-1 and a[i] != a[i+1]:
      cnt += 1
    elif i == n-1:
      cnt += 1
    for j in range(d, 10**6 + 1, d):
      l[d] = False
print(cnt)
# Judge status: Accepted
li = ["MON","TUE","WED","THU","FRI","SAT","SUN"]
s = input()
if s=="SUN":
    print(7)
else:
    i = li.index(s)
    print(6-i)
# Judge status: Wrong Answer
a, b = map(int, input().split())

ans = 0

for i in range(1, a+1):
    for j in range(1, b+1):
        if i==j:
            ans += 1
            
print(ans)
# Judge status: Accepted
N = int(input())

cnt = 0
for i in range(1, N+1):
    i = str(i)
    if len(i)%2 != 0:
        cnt += 1
    
print(cnt)
# Judge status: Accepted
n = int(input())
l = list(map(int,input().split()))
l = sorted(l)

c=0

import bisect

for i in range(n-2):
    for j in range(i+1, n-1):
        c += bisect.bisect_left(l, l[i]+l[j]) - j - 1
print(c)
# Judge status: Accepted
t = list(map(int,input().split()))

if t.count(5)==2 and t.count(7)==1:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
import sys
n=int(input())
S=input()
if n%2==0:
    s=S[:n//2]
    t=S[n//2:]
    if s==t:
        print("Yes")
        sys.exit()
print("No")