Harryxun/stf_run huggingface dataset:
# -*- coding: utf-8 -*-
import sys,math
from functools import reduce
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    N = int(lines.pop(0))
    A = list(map(int, lines.pop(0).split(' ')))

    _l = 0
    L = []
    for i in range(N):
        _l = math.gcd(_l, A[i])
        L.append(_l)

    _r = 0
    R = []
    for i in range(N):
        _r = math.gcd(_r, A[N-i-1])
        R.append(_r)

    print(max([math.gcd(l,r) for l, r in zip(L,R)]))



lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys,fractions
from functools import reduce
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    N = int(lines.pop(0))
    A = list(map(int, lines.pop(0).split(' ')))

    _l = 0
    L = []
    for i in range(N-1):
        _l = fractions.gcd(_l, A[i])
        L.append(_l)
    L.insert(0,0)

    _r = 0
    R = []
    for i in range(N-1):
        _r = fractions.gcd(_r, A[N-i-1])
        R.append(_r)
    R.reverse()
    R.append(0)

    print(max([fractions.gcd(l,r) for l, r in zip(L,R)]))



lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)
from sys import stdin
input = stdin.readline


a, b = map(str, input().split())
a = int(a)
b = int((float(b) + 0.001) * 100)
ans = int(a * b // 100)
print(ans)


### FIXED CODE ###

from sys import stdin
input = stdin.readline


a, b = map(str, input().split())
a = int(a)
b = int((float(b) + 0.001) * 100)
ans = int(a * b // 100)
print(ans)
N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))
D = []
for _ in range(M):
    b, c = map(int, input().split())
    for i in range(b):
        D.append(c)
D.sort(reverse=True)
for i in range(len(A)):
    if A[i] < D[i]:
        A[i] = D[i]
    else:
        break
print(sum(A))


### FIXED CODE ###

def cD():
    D = []
    for bc in BC:
        for i in range(bc[1]):
            D.append(bc[0])
            if len(D) > N:
                return D
    return D


N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))
BC = []
for _ in range(M):
    b, c = map(int, input().split())
    BC.append([c, b])
BC.sort(reverse=True)
D = cD()
for i in range(min(len(A), len(D))):
    if A[i] < D[i]:
        A[i] = D[i]
    else:
        break
print(sum(A))
import math
n, m = map(int, input().split())
a = list(map(int, input().split()))
num = 1
for x in a:
    num = num * (x//2) // math.gcd(num, x)
cnt = 0
print(m//num-(m//num)//2)

### FIXED CODE ###

import math
import fractions
n, m = map(int, input().split())
a = list(map(int, input().split()))
num = 1
cnt = []
for x in a:
    c = 0
    for i in range(int(math.log(x,2))):
        if x>>c&1:
            break
        else:
            c+=1
    cnt.append(c)
if max(cnt) != min(cnt):
    print(0)
else:
    for x in a:
        num = num * (x//2) // fractions.gcd(num, x//2)
    print(m//num-(m//num)//2)
import functools


def divise(n, divisor):
    if n == divisor:
        return n
    elif n % divisor == 0:
        return 0
    else:
        return n

number = int(input())
origin = list(int(input()) for x in range(number))

divised = origin

for i in range(2, max(origin)+1):
    divised = list(map(functools.partial(divise, divisor=i), divised))

for j in range(number):
    if divised[j] == 0:
        origin.pop(j)
    else:
        pass

print(len(origin))

### FIXED CODE ###

def is_prime(n):
    i = 2
    while i * i <= n:
        if n % i == 0:
            return False
        i += 1
    return True

count = 0

number = int(input())
for i in range(number):
    n = int(input())
    if is_prime(n):
        count = count + 1

print(count)
n,m=map(int,input().split())
s=input()
s[m].lower()
print(s)

### FIXED CODE ###

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

S[K-1] = S[K-1].lower()

S = ''.join(S)
print(S)
iimport numpy as np
N = int(input())
a = [int(input()) for _ in range(N)]
mod = 998244353
suma = sum(a)
memo = np.zeros((N+1, suma+1), dtype=np.int)
memo[0][0] = 1
memoe = np.zeros((N+1, suma+1), dtype=np.int)
memoe[0][0] = 1

ttl = 3
for i in range(N-1):
  ttl *=3
  ttl %= mod

for i in range(1, N+1):
  memotmp = memo[i-1]
  memotmpe = memoe[i-1]
  memotmp = np.concatenate((np.zeros((a[i-1]), dtype=np.int), memotmp),axis=1)
  memotmpe = np.concatenate((np.zeros((a[i-1]), dtype=np.int), memotmpe),axis=1)
  memo[i] = (memo[i-1]*2 + memotmp[:suma+1])%mod
  memoe[i] = (memoe[i-1] + memotmpe[:suma+1])%mod

ans = sum(memo[N][(suma-1)//2+1:])
if suma%2==0:
  ans -= memoe[N][suma/2]
  
print(((ttl - ans*3)%mod+mod)%mod)

### FIXED CODE ###

import numpy as np
N = int(input())
a = [int(input()) for _ in range(N)]
mod = 998244353
suma = sum(a)
memo = np.zeros((N+1, suma+1), dtype=np.int)
memo[0][0] = 1
memoe = np.zeros((N+1, suma+1), dtype=np.int)
memoe[0][0] = 1

ttl = 3
for i in range(N-1):
  ttl *=3
  ttl %= mod

for i in range(1, N+1):
  memotmp = memo[i-1]
  memotmpe = memoe[i-1]
  memotmp = np.concatenate((np.zeros((a[i-1]), dtype=np.int), memotmp),axis=1)
  memotmpe = np.concatenate((np.zeros((a[i-1]), dtype=np.int), memotmpe),axis=1)
  memo[i] = (memo[i-1]*2 + memotmp[:suma+1])%mod
  memoe[i] = (memoe[i-1] + memotmpe[:suma+1])%mod

ans = sum(memo[N][(suma-1)//2+1:])
if suma%2==0:
  ans -= memoe[N][suma/2]
  
print(((ttl - ans*3)%mod+mod)%mod)
print(3 * (int(input())**2 )

### FIXED CODE ###

r = int(input())
print(3 * r**2)
mod = 10 ** 9 + 7
n = int(input())
nums = list(map(int, input().split()))

n_colors = [0, 0, 0]

cnt = 1
for x in nums:
	cnt = (cnt * len([y for y in n_colors if x == y])) % mod
	n_colors[n_colors.index(x)] += 1

print(cnt)

### FIXED CODE ###

mod = 10 ** 9 + 7
n = int(input())
nums = list(map(int, input().split()))

n_colors = [0, 0, 0]

cnt = 1
for x in nums:
	cnt = (cnt * len([y for y in n_colors if x == y])) % mod
	if cnt == 0:
		break
	n_colors[n_colors.index(x)] += 1

print(cnt)
import math
import numpy as np
import itertools
N = int(input())
x = []
y = []
for i in range(N):
    s1,s2 = map(int,input().split())
    x.append(s1)
    y.append(s2)
    
def length(i,j):
    return np.sqrt((x[i]-x[j])**2+(y[i]-y[j])**2)

LI = [i for i in range(N)]
A = list(itertools.permutations(LI))
ans = 0
for item in A:
#     print(item)
    count = 0
    for i in range(len(item)):
        if i == len(item)-1:
            break
#         print(length(item[count],item[count+1]))
        ans = ans+length(item[count],item[count+1])
        count +=1
print(ans/math.factorial(N))

### FIXED CODE ###

import math
# import numpy as np
import itertools
N = int(input())
x = []
y = []
for i in range(N):
    s1,s2 = map(int,input().split())
    x.append(s1)
    y.append(s2)
    
def length(i,j):
    return math.sqrt((x[i]-x[j])**2+(y[i]-y[j])**2)

LI = [i for i in range(N)]
A = list(itertools.permutations(LI))
ans = 0
for item in A:
#     print(item)
    count = 0
    for i in range(len(item)):
        if i == len(item)-1:
            break
#         print(length(item[count],item[count+1]))
        ans = ans+length(item[count],item[count+1])
        count +=1
print(ans/math.factorial(N))
import itertools
import numpy as np

def powerset(L):
  pset = set()
  for n in range(len(L) + 1):
    for sset in itertools.combinations(L, n):
      pset.add(sset)
  return pset
    
def list_diff(first, second):
        first = first.copy()
        for s in second:
            first.remove(s)
        return first

def main():
    N = int(input())
    facs = factors(N)
    st = powerset(facs)

    mn_ij = 10**12
    for i in st:
        i = list(i)
        j = list_diff(facs, i)
        i, j = np.prod(i), np.prod(j)

        assert i * j == N, f'{i} {j} {N}'
        mn_ij = min(mn_ij, i+j)

    print(int(mn_ij-2))

if __name__ == "__main__":
    main()


### FIXED CODE ###

import math

def main():
    N = int(input())
    rt_N = math.ceil(math.sqrt(N))

    mn_ij = 10**12
    for i in range(1, rt_N+1):
        if N % i == 0:
            j = N // i

            mn_ij = min(mn_ij, i+j)
        
        mn_ij = min(mn_ij, i+j)

    # print(list(map(len,[ st, facs]) ))
    print(int(mn_ij-2))

if __name__ == "__main__":
    main()
N = int(input())
H = list(map(int, input().split(' ')))

is_trimmed = [False] * N
max_v = 0
max_ids = []
succeed = True
for i in range(N):
    if max_v > H[i]:
        if max_v - H[i] > 1:
            print('No')
            succeed = False
            break
        if max_v - H[i] == 1:
            for j in max_ids:
                if is_trimmed[j]:
                    print('No')
                    succeed = False
                    break
                is_trimmed[j] = True
    elif max_v == H[i]:
        max_ids.append(i)
    elif max_v < H[i]:
        max_v = max(max_v, H[i])
        max_ids = [i]
    print(max_v, max_ids, is_trimmed)

if succeed:
    print('Yes')


### FIXED CODE ###

N = int(input())
H = list(map(int, input().split(' ')))

is_trimmed = [False] * N
max_v = 0
max_ids = []
succeed = True
for i in range(N):
    diff = max_v - H[i]
    if diff > 1:
        print('No')
        succeed = False
        exit(0)
    elif diff == 1:
        for j in max_ids:
            if is_trimmed[j]:
                print('No')
                succeed = False
                exit(0)
            is_trimmed[j] = True
        max_ids.append(i)
        max_v -= 1
    elif diff == 0:
        max_ids.append(i)
    elif diff < 0:
        max_v = max(max_v, H[i])
        max_ids = [i]
    # print(max_v, max_ids, is_trimmed)

if succeed:
    print('Yes')
n = input()

dp = [[0] * 2 for _ in range(101)]

digit = int(n[-1])

dp[0][0] = 10 - digit
dp[0][1] = digit

for i in range(1, len(n) + 1):
    if i == len(n):
        digit = 0
    else:
        digit = int(n[-i-1])
    dp[i][0] = min(dp[i-1][0] + 10 - digit - 1, dp[i-1][1] + 10 - digit)
    dp[i][1] = min(dp[i-1][0] + digit + 1, dp[i-1][1] + digit)


print(min(dp[len(n)][1], dp[len(n)-1][1]))


### FIXED CODE ###

n = input()

dp = [[0] * 2 for _ in range(2)]

digit = int(n[-1])

dp[0][0] = 10 - digit
dp[0][1] = digit

for i in range(1, len(n) + 1):
    if i == len(n):
        digit = 0
    else:
        digit = int(n[-i-1])

    if i % 2 == 0:
        dp[0][0] = min(dp[1][0] + 10 - digit - 1, dp[1][1] + 10 - digit)
        dp[0][1] = min(dp[1][0] + digit + 1, dp[1][1] + digit)
    else:
        dp[1][0] = min(dp[0][0] + 10 - digit - 1, dp[0][1] + 10 - digit)
        dp[1][1] = min(dp[0][0] + digit + 1, dp[0][1] + digit)


print(min(dp[0][1], dp[1][1]))
S = input()
Q = int(input())
Query = list(input().split() for _ in range(Q))

count = 0
L, R = "", ""

for i in range(Q):
  if Query[i][0] == "1": count += 1
  else:
    if Query[i][1] == "1":
      if count % 2 == 0: L = Query[i][2] + L
      else: R += Query[i][2]
    else:
      if count % 2 == 0: R += Query[i][2]
      else: L = Query[i][2] + L
  print(L + S + R)

if count % 2 == 0: print(L + S + R)
else: print(R[::-1] + S[::-1] + L[::-1])

### FIXED CODE ###

S = input()
Q = int(input())
Query = list(input().split() for _ in range(Q))

count = 0
L, R = "", ""

for i in range(Q):
  if Query[i][0] == "1": count += 1
  else:
    if Query[i][1] == "1":
      if count % 2 == 0: L = Query[i][2] + L
      else: R += Query[i][2]
    else:
      if count % 2 == 0: R += Query[i][2]
      else: L = Query[i][2] + L

if count % 2 == 0: print(L + S + R)
else: print(R[::-1] + S[::-1] + L[::-1])
n, m = map(int, input().split())
ks = [[0] for i in range(m)]
jud = []
for i in range(m):
    tmp = list([int(i)-1 for i in input().split()])
    ks[i] = tmp[1:]
jud = list(map(int, input().split()))

ans = 0
c = True
for i in range(2 ** n):
    tmp = list()
    c = True
    for j in range(m):
        t = ks[j]
        ch = 0
        for m in t:
            ch += tmp[m]
        if ch % 2 != jud[j]:
            c = False
            break
    if c:
        ans += 1
print(ans)


### FIXED CODE ###

n, m = map(int, input().split())
ks = [[0] for i in range(m)]
jud = []
for i in range(m):
    tmp = list([int(i)-1 for i in input().split()])
    ks[i] = tmp[1:]
jud = list(map(int, input().split()))

ans = 0
c = True
for i in range(2 ** n):
    c = True
    ib = format(i, 'b')
    for iks, j in enumerate(ks):
        ch = 0
        for m in j:
            if len(ib) >= m+1:
                ch += int(ib[-m-1])
        if ch % 2 != jud[iks]:
            c = False
            break
    if c:
        ans += 1
print(ans)
def ABC076C_DubiousDocument2():
    Sd = list(input().strip())
    T = list(input().strip())

    tlen = len(T)
    slen = len(Sd)

    ans = 'UNRESTORABLE'
    nowPos = 0
    for pos in range(slen - 1, -1, -1):
        if pos < tlen:
            break
        if(T[tlen - (slen - 1 - pos) - 1] == Sd[pos]) or (Sd[pos] == '?'):
            nowPos = pos
            match = True
            for chk in range(nowPos, nowPos - tlen, -1):
                if(T[tlen - (nowPos - chk) - 1] != Sd[chk]) and (Sd[chk] != '?'):
                    match = False
                    break

            if match:
                # 書き換え
                for chk in range(nowPos, nowPos - tlen, -1):
                    Sd[chk] = T[tlen - (nowPos - chk) - 1]
                for i in range(0, slen):
                    if Sd[i] == '?':
                        Sd[i] = 'a'
                # 答えはこれ
                ans = ''.join(Sd)

    print(ans)

def main():
    ABC076C_DubiousDocument2()

if __name__ == "__main__":
    main()


### FIXED CODE ###

def ABC076C_DubiousDocument2():
    Sd = list(input().strip())
    T = list(input().strip())

    tlen = len(T)
    slen = len(Sd)

    ans = 'UNRESTORABLE'
    nowPos = 0
    for pos in range(slen - 1, -1, -1):
        if pos < (tlen - 1):
            break
        if(T[tlen - 1] == Sd[pos]) or (Sd[pos] == '?'):
            nowPos = pos
            match = True
            for chk in range(nowPos, nowPos - tlen, -1):
                if(T[tlen - (nowPos - chk) - 1] != Sd[chk]) and (Sd[chk] != '?'):
                    match = False
                    break

            if match:
                # 書き換え
                for chk in range(nowPos, nowPos - tlen, -1):
                    Sd[chk] = T[tlen - (nowPos - chk) - 1]
                for i in range(0, slen):
                    if Sd[i] == '?':
                        Sd[i] = 'a'
                # 答えはこれ
                ans = ''.join(Sd)

    print(ans)

def main():
    ABC076C_DubiousDocument2()

if __name__ == "__main__":
    main()
X = int(input())
fh = x // 500
f = (x - (500*fh)) // 5
pint(f+fh)

### FIXED CODE ###

x = int(input())
fh = x // 500
f = (x - (500*fh)) // 5
sum = f*5+fh*1000
print(sum)
a,b=map(int,input().split())
s=list(map(int,input().split()))
ans=[]
for i in range(b-1):
    ans.append(s[i]-s[i-1])
ans.append(a-s[b]+s[0])
print(sum(ans)-max(ans))







### FIXED CODE ###

a,b=map(int,input().split())
s=list(map(int,input().split()))
ans=[]
for i in range(b-1):
    ans.append(s[i+1]-s[i])
ans.append(a-s[b-1]+s[0])
print(a-max(ans))
import math

a = []
for i in range(2):
    a.append(input)
tmp = math.floor(a[0]/500)
tmp1 = a[0] - tmp*500
if a[1] >= tmp1:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

import math
 
a = []
for i in range(2):
    a.append(int(input()))
tmp = math.floor(a[0]/500)
tmp1 = a[0] - tmp*500
if a[1] >= tmp1:
    print('Yes')
else:
    print('No')
def main():
    a , b =[int(_) for _ in input.split()]
    print('Even') if a * b % 2 ==0 else print('Odd')
    
main()

### FIXED CODE ###

def main():
    a, b = [int(_) for _ in input().split()]
    print("Even") if a * b % 2 == 0 else print("Odd")

main()
def gcd(a, b):
    while a:
        a, b = b % a, a
    return b

A, B = map(int, input().split())
print(A // GCD(A, B) * B)

### FIXED CODE ###

def GCD(a, b):
    while a:
        a, b = b % a, a
    return b


def main():
    A, B = map(int, input().split())
    print(A // GCD(A, B) * B)


main()
from math import gcd
a,b,c,d=map(int,input().split())
e=int(c*d/gcd(c,d))

rng=b-a+1
x=b//c-(a-1)//c
y=b//d-(a-1)//d
z=b//e-(a-1)//e
print(rng-x-y+z)

### FIXED CODE ###

def gcd(x,y):
    x,y=max(x,y),min(x,y)
    if y==0:
        return x
    return gcd(y, x%y)


a,b,c,d=map(int,input().split())
e=int(c*d/gcd(c,d))

rng=b-a+1
x=b//c-(a-1)//c
y=b//d-(a-1)//d
z=b//e-(a-1)//e
print(rng-x-y+z)
print("ABC" if input()<1200 else "ARC")


### FIXED CODE ###

print("ABC" if int(input())<1200 else "ARC")
from math import sqrt
if c - a - b > 0 and 2 * sqrt(a * b) < c - a - b:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

from decimal import Decimal
a, b, c = map(int, input().split())
if Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt():
    print("Yes")
else:
    print("No")
rom sys import stdin
import fractions

N = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]

lcm_a = int(A[0] * A[1] // fractions.gcd(A[0], A[1]))

if len(A) > 2:
    for k in A[2:]:
        lcm_a = int(lcm_a * k // fractions.gcd(lcm_a, k))

modulo_sum = 0

for k in A:
    modulo_sum += (lcm_a - 1) % k

print(modulo_sum)


### FIXED CODE ###

from sys import stdin

N = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]

lcm_a = A[0] * A[1]

if len(A) > 2:
    for k in A[2:]:
        lcm_a = lcm_a * k

modulo_sum = 0

for k in A:
    modulo_sum += (lcm_a - 1) % k

print(modulo_sum)
import math

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

kakudo = abs((H*30+0.5*M-M*6)%180) 

a = (A**2 + B**2 - 2*A*B*math.cos(math.radians(kakudo)))
print(math.sqrt(a))

### FIXED CODE ###

N = input()

if int(N[-1]) in [2,4,5,7,9]:
    print("hon")
elif int(N[-1]) in [0,1,6,8]:
    print("pon")
else:print("bon")
n,q=map(int,input().split())
s=input()
lr=[list(map(int,input().split())) for _ in range(q)]
L=[0,0]
c=0
for i in range(1,n+1):
	if s[i-1]=='A' and s[i]=='C':
		c += 1
	L.append(c)
print(L)
for l,r in lr:
	print(L[r]-L[l])

### FIXED CODE ###

n,q=map(int,input().split())
s=input()
lr=[list(map(int,input().split())) for _ in range(q)]
L=[0]
c=0
for i in range(n-1):
	if s[i]=='A' and s[i+1]=='C':
		c += 1
	L.append(c)
for l,r in lr:
	print(L[r-1]-L[l-1])
from collections import Counter
n = int(input())
a = [tuple(map(int, input().split())) for _ in range(n)]
c = Counter((y[0] - x[0], y[1] - x[1]) for i, x in enumerate(a) for y in a[:i])
print(n - max(c.values()))


### FIXED CODE ###

from collections import Counter
n = int(input())
a = [tuple(map(int, input().split())) for _ in range(n)]
c = Counter((y[0] - x[0], y[1] - x[1]) for x in a for y in a if x < y)
print(n - max(c.values(), default=0))
def f(x):
    if x == 1:
        return 2
    if x == 2:
        return 5
    if x == 3:
        return 5
    if x == 4:
        return 4
    if x == 5:
        return 5
    if x == 6:
        return 6
    if x == 7:
        return 3
    if x == 8:
        return 7
    if x == 9:
        return 6
n,m = map(int,input().split())
a = list(map(int,input().split()))
if 2 in a and 3 in a:
    a.remove(2)
    m -=1
if 2 in a and 5 in a:
    a.remove(2)
    m -=1
if 3 in a and 5 in a:
    a.remove(3)
    m -=1
if 6 in a and 9 in a:
    a.remove(6)
    m -=1
for w in range(1,10):
    if n < f(w):
        a.remove(w)
        m -=1
a.sort()
m = len(a)

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


def g(k):
    cand = [0]*(m+1)
    for i in range(m):
        if k - f(a[i])>=0:
            if cand[0] <= dp[k-f(a[i])][0]+1 and dp[k-f(a[i])][0] != 0:
                for r in range(m+1):
                    cand[r] = dp[k-f(a[i])][r]
                cand[0] += 1
                cand[i+1] += 1
    if sum(cand) != 0:
        dp[k] = cand
for i in range(m):
    if f(a[i]) <= n:
        dp[f(a[i])][0] = 1
        dp[f(a[i])][i+1] = 1
print(1) 

### FIXED CODE ###

# cook your dish here
def f(x):
    if x == 1:
        return 2
    if x == 2:
        return 5
    if x == 3:
        return 5
    if x == 4:
        return 4
    if x == 5:
        return 5
    if x == 6:
        return 6
    if x == 7:
        return 3
    if x == 8:
        return 7
    if x == 9:
        return 6
n,m = map(int,input().split())
a = list(map(int,input().split()))
if 2 in a and 3 in a:
    a.remove(2)
    m -=1
if 2 in a and 5 in a:
    a.remove(2)
    m -=1
if 3 in a and 5 in a:
    a.remove(3)
    m -=1
if 6 in a and 9 in a:
    a.remove(6)
    m -=1
for w in range(1,10):
    if n < f(w) and w in a:
        a.remove(w)
        m -=1
a.sort()
m = len(a)

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


def g(k):
    cand = [0]*(m+1)
    for i in range(m):
        if k - f(a[i])>=0:
            if cand[0] <= dp[k-f(a[i])][0]+1 and dp[k-f(a[i])][0] != 0:
                for r in range(m+1):
                    cand[r] = dp[k-f(a[i])][r]
                cand[0] += 1
                cand[i+1] += 1
    if sum(cand) != 0:
        dp[k] = cand
for i in range(m):
    if f(a[i]) <= n:
        dp[f(a[i])][0] = 1
        dp[f(a[i])][i+1] = 1

for j in range(1,n+1):
    g(j)

ass = ''

for i in range(m):
    for k in range(dp[n][m-i]):
        ass += str(a[m-i-1])
print(ass)
n = int(input())
a = list(map(int, input().split()))

def func(a):
  count = [0] * (max(a)+1)

  for i in a:
      count[i] += 1

  max_n = 0
  for j in range(1, len(count)-1):
      max_n = max(max_n, count[j] + count[j-1] + count[j+1])
  max_n = max(max_n, count[-1] + count[-2])
  
  return max_n

ptint(n if len(set(a)) == 1 else func(a))

### FIXED CODE ###

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

def func(a):
  count = [0] * (max(a)+1)

  for i in a:
      count[i] += 1

  max_n = 0
  for j in range(1, len(count)-1):
      max_n = max(max_n, count[j] + count[j-1] + count[j+1])
  max_n = max(max_n, count[-1] + count[-2])

  return max_n

print(n if len(set(a)) == 1 else func(a))
import numpy as np
N,K = map(int, input().split())
p = np.array(list(map(int,input().split())))
p = (p+1)/2
ans = 0.0
for i in range(N-K+1):
    buf = sum(p[i:i+K])
    if ans < buf:
        ans = buf
print(ans)


### FIXED CODE ###

import numpy as np
N,K = map(int, input().split())
p = [(int(i)+1)/2 for i in input().split()]
s = [0]*N
s[0] = p[0]
if N==K:
    print(sum(p))
else:
    for i in range(N-1):
        s[i+1] = s[i]+p[i+1]
    ans=max(s[i+K]-s[i] for i in range(N-K))
    print(ans)
a = input()
b = input()

ans1 = a * b
ans2 = 2 * ( a + b )

print ans1  ' '  ans2

### FIXED CODE ###

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

ans1 = a * b
ans2 = 2 * ( a + b )

print ans1 , ans2
n, x = map(int, input().split())

table_l = [-1 for _ in range(50)]
table_p = [-1 for _ in range(50)]
table_l[0] = 1
table_p[0] = 1

for i in range(1, 50):
    table_l[i] = table_l[i-1] * 2 + 3
    table_p[i] = table_p[i-1] * 2 + 1


def f(level, x):
    if level == 1:
        if x == 0 or x == 1:
            return 0
        if x == 2:
            return 1
        if x == 3:
            return 2
        else:
            return 3

    if table_l[level] == x:
        return table_p[level]

    if x - 1 <= table_l[level - 1]:
        return f(level - 1, x - 1)

    if x - 2 == table_l[level - 1]:
        return table_p[level - 1] + 1
    if x - 2 > table_l[level - 1]:
        xx = x - 2 - table_l[level - 1]
        return table_p[level - 1] + 1 + f(level - 1, xx)


print(f(n, x))


### FIXED CODE ###

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

table_l = [-1 for _ in range(51)]
table_p = [-1 for _ in range(51)]
table_l[0] = 1
table_p[0] = 1

for i in range(1, 51):
    table_l[i] = table_l[i-1] * 2 + 3
    table_p[i] = table_p[i-1] * 2 + 1


def f(level, x):
    if level == 1:
        if x == 0 or x == 1:
            return 0
        if x == 2:
            return 1
        if x == 3:
            return 2
        else:
            return 3

    if table_l[level] == x:
        return table_p[level]

    if x - 1 <= table_l[level - 1]:
        return f(level - 1, x - 1)

    if x - 2 == table_l[level - 1]:
        return table_p[level - 1] + 1
    if x - 2 > table_l[level - 1]:
        xx = x - 2 - table_l[level - 1]
        return table_p[level - 1] + 1 + f(level - 1, xx)


print(f(n, x))
z = 1
x = []
while z != 5:
  x.append[input()]
  z+=
y = 0
while y!= 5:
  if x[y] == 0:
    print(y+1)
  else:
    y+=1
    continue

### FIXED CODE ###

num = list(map(int, input().split()))
print(num.index(0)+1)