Harryxun/stf_run huggingface dataset:
n = int(input())
a = [int(i) for i in input().split()]
l_list = [0]
r_list = [0]
for i in range(n):
    l = gcd(l_list[i], a[i])
    l_list.append(l)
    r = gcd(r_list[-1], a[-i-1])
    r_list.append(r)
r_list = list(reversed(r_list))
r_list = r_list[1:]
l_list = l_list[:n]
c_list = []
for i in range(n):
    c_list.append(gcd(l_list[i], r_list[i]))
print(max(c_list))

### FIXED CODE ###

def gcd(x, y):
    if x * y == 0:
        return (x+y)
    x, y = max(x, y), min(x, y)
    while y > 0:
        r = x % y
        x, y = y, r
    return x

n = int(input())
a = [int(i) for i in input().split()]
l_list = [0]
r_list = [0]
for i in range(n):
    l = gcd(l_list[i], a[i])
    l_list.append(l)
    r = gcd(r_list[-1], a[-i-1])
    r_list.append(r)
r_list = list(reversed(r_list))
r_list = r_list[1:]
l_list = l_list[:n]
c_list = []
for i in range(n):
    c_list.append(gcd(l_list[i], r_list[i]))
print(max(c_list))
N = int(input())
d = [int(x) for x in input().split()]
total = 0
for i in itertools.permutations(d, N):
    total = i[0]*i[1]
print(total)

### FIXED CODE ###

N = int(input())
d = [int(x) for x in input().split()]
t = 0
for i in range(N-1):
    for j in range(i+1, N):
      t += d[i]*d[j]
print(t)
k,x = map(int,input().split())
a = x+k-1
b = x-k+1
l = range[b:a+1]
print(l)


### FIXED CODE ###

k,x = map(int,input().split())
for a in range(x-k+1,x+k):
    print(a ,end=" ")
N=int(input())
A=list(map(int,input().split()))
Q=int(input())
bc = [[0 for i in range(2)] for j in range(Q)]
for i in range(Q):
  bc[i] = list(map(int,input().split()))

count = [0 for i in range(100000)]
for i in range(N):
  count[A[i]] += 1

sum_ = sum(A)
for i in range(Q):
  b,c = bc[i]
  n = count[b]
  sum_ -= b*n
  sum_ += c*n
  count[c] += n
  print(sum_)

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
count = [0 for i in range(110000)]
sum_ = sum(A)
for i in range(N):
  count[A[i]] += 1

Q=int(input())
for i in range(Q):
  b,c = map(int,input().split())
  count[c] += count[b]
  sum_ += (c-b)*count[b]
  count[b] = 0
  print(sum_)
n=int(input())
a=[x-i for i,x in enumerate(list(map(int,input().split())))]
if n%2==0:
  print(sum([abs(x-a[n//2]) for x in a]))
else:
  print(min(sum([abs(x-a[n//2]) for x in a]),sum([abs(x-a[n//2+1]) for x in a])))

### FIXED CODE ###

n=int(input())
a=sorted([x-i for i,x in enumerate(list(map(int,input().split())))])
if n%2==1:
  print(sum([abs(x-a[n//2]) for x in a]))
else:
  print(min(sum([abs(x-a[n//2]) for x in a]),sum([abs(x-a[n//2+1]) for x in a])))
# encoding: utf-8
N, M = list(map(int, input().split()))

# TLE
Amod = [A for A in map(lambda x: int(x) % M ,filter(lambda x: int(x) % M > 0, input().split()))]
ans = 0
for l in range(len(Amod)):
    acm = 0
    for r in range(l, len(Amod)):
        acm = (acm + Amod[r]) % M
        if acm == 0: ans += 1


### FIXED CODE ###

# encoding: utf-8

n, k = input().split()

if int(n) % int(k) == 0: print(0)
else: print(1)
#!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin


def solve(a, al, m, i):
    if m == 0:
        return True
    if m > 0 and i < al:
        if solve(a, al, m-a[i], i+1) or solve(a, al, m, i+1):
            return True
    return False


stdin.readline()
a = [int(s) for s in stdin.readline().split()]
stdin.readline()
ms = [int(s) for s in stdin.readline().split()]

for m in ms:
    if solve(a, len(a), m, 0):
        print('yes')
    else:
        print('no')

### FIXED CODE ###

#!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin
from itertools import combinations


def enum_sum_numbers(sets, s_range, r):
    for cmb in combinations(sets, r):
        yield sum(cmb)
    if r <= s_range:
        for s in enum_sum_numbers(sets, s_range, r+1):
            yield s


stdin.readline()
a = [int(s) for s in stdin.readline().split()]
stdin.readline()
ms = [int(s) for s in stdin.readline().split()]
sets = {s for s in enum_sum_numbers(a, len(a), 1)}

for m in ms:
    print('yes' if m in sets else 'no')
A, B, C = int(input()).split()

if B+C <= 20
print(0)

else B+C > 20
print(C-A+B)

### FIXED CODE ###

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

answer = C-A+B

if answer >= 0:
	print(answer)

else :
	print(0)
# coding: utf-8
import sys


def solve(a, begin, end, queue):
    if begin >= end:
        return
    if end - begin == 1:
        return
    maxx = sorted(list(map(abs, a[begin:end + 1])), reverse=True)[0]
    if maxx in a:
        m = a.index(maxx)
    else:
        m = a.index(-1 * maxx)
        maxx = -1 * maxx
    if maxx == 0:
        return []
    if maxx > 0:
        solve(a, begin, m - 1, queue)
        for i in range(max(0, m - 1), end):
            if a[i + 1] >= a[i]:
                continue
            else:
                a[i + 1] += a[i]
                queue.append((i, i + 1))
                if a[i + 1] < a[i]:
                    a[i + 1] += a[i]
                    queue.append((i, i + 1))
        return queue
    if maxx < 0:
        solve(a, m + 1, end, queue)
        for i in reversed(range(begin, min(len(a) - 1, m + 1))):
            if a[i] <= a[i + 1]:
                continue
            else:
                a[i] += a[i + 1]
                queue.append((i + 1, i))
                if a[i] > a[i + 1]:
                    a[i] += a[i + 1]
                    queue.append((i + 1, i))
        return queue


if __name__ == '__main__':
    n = int(input())
    a = list(map(int, input().split()))
    queue = solve(a, 0, len(a) - 1, [])
    print(len(queue))
    for i in range(len(queue)):
        print(queue[i][0] + 1, queue[i][1] + 1)


### FIXED CODE ###

# coding: utf-8
import sys


def solve(a, begin, end, queue, cnt):
    #print(begin, end)
    if begin >= end:
        return
    maxx = sorted(list(map(abs, a[begin:end + 1])), reverse=True)[0]
    # print(maxx)
    if maxx in a[begin:end + 1]:
        m = a[begin:end + 1].index(maxx) + begin
    else:
        m = a[begin:end + 1].index(-1 * maxx) + begin
        maxx = -1 * maxx
    #print(m, maxx)
    if maxx == 0:
        return []
    if maxx > 0:
        solve(a, begin, m - 1, queue, cnt + 1)
        for i in range(max(0, m - 1), end):
            if a[i + 1] >= a[i]:
                continue
            else:
                a[i + 1] += a[i]
                queue.append((i, i + 1))
                if a[i + 1] < a[i]:
                    a[i + 1] += a[i]
                    queue.append((i, i + 1))
        return queue
    if maxx < 0:
        solve(a, m + 1, end, queue, cnt + 1)
        for i in reversed(range(begin, min(len(a) - 1, m + 1))):
            if a[i] <= a[i + 1]:
                continue
            else:
                a[i] += a[i + 1]
                queue.append((i + 1, i))
                if a[i] > a[i + 1]:
                    a[i] += a[i + 1]
                    queue.append((i + 1, i))
        return queue


if __name__ == '__main__':
    n = int(input())
    a = list(map(int, input().split()))
    queue = solve(a, 0, len(a) - 1, [], 0)
    print(len(queue))
    for i in range(len(queue)):
        print(queue[i][0] + 1, queue[i][1] + 1)
n=int(input())
ans=0
for i in range(n):
    if i%3!=0 and i%5=!=0:
        ans=ans+i
print(ans)

### FIXED CODE ###

n=int(input())
ans=0
for i in range(n+1):
    if i%3!=0 and i%5!=0:
        ans+=i
print(ans)
import bisect
x, n = map(int, input().split())
pN = list(map(int, input().split()))
plus_flag = 1
minus_flag = 1
pN.sort()
key_index = bisect.bisect(pN, x) - 1
plus_index = key_index
minus_index = key_index

if n == 0:
    print(x)
else:
    while(1):
        if minus_index <= 0:
            minus_flag = 0
            
        if minus_flag == 1:
            if pN[minus_index] - 1 != pN[minus_index-1]:
                print(pN[minus_index] - 1)
                break
            else:
                minus_index = minus_index + 1

        

        if plus_index == n:
                    plus_flag = 0

        if plus_flag == 1:
            if pN[plus_index] + 1 != pN[plus_index+1]:
                print(pN[plus_index] + 1)
                break
            else:
                plus_index = plus_index + 1

### FIXED CODE ###

import bisect
x, n = map(int, input().split())
pN = list(map(int, input().split()))

pN.sort()

diff = 0

if n == 0:
    print(x)
else:
    while(1):
        if x-diff not in pN:
            print(x-diff)
            exit()
        elif x+diff not in pN:
            print(x+diff)
            exit()
        diff+=1
import math

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

if b <= 10**6
    maxVal = 0

    for i in range(b):
        if i > n:
            break
        val = math.floor(a*i/b)-a*math.floor(i/b)
        if val > maxVal:
            maxVal = val

    print(maxVal)
elif n > b:
    print(a-1)
elif n == b:
    m = n - 1
    print(math.floor(a*m/b)-a*math.floor(m/b))
else:
    print(math.floor(a*n/b)-a*math.floor(n/b))

### FIXED CODE ###

import math

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

if b <= 10**6:
    maxVal = 0

    for i in range(b):
        if i > n:
            break
        val = math.floor(a*i/b)-a*math.floor(i/b)
        if val > maxVal:
            maxVal = val

    print(maxVal)
elif n > b:
    print(a-1)
elif n == b:
    m = n - 1
    print(math.floor(a*m/b)-a*math.floor(m/b))
else:
    print(math.floor(a*n/b)-a*math.floor(n/b))
# -*- coding: utf-8 -*-
input_line_1 = raw_input()
fields = input_line_1.split()
N = fields[0]
A = fields[1]
B = fields[2]
T = A + B
all = raw_input()
for every in all:
	if every == 'c':
		print 'No'
	else if every == 'a':
		if T > 0:
			T = T - 1
			print 'Yes'
		else:
			print 'No'
	else:
		if T > 0 and B > 0:
			T = T - 1
			B = B - 1
			print 'Yes'
		else:
			print 'No'

### FIXED CODE ###

# -*- coding: utf-8 -*-
input_line_1 = raw_input()
fields = input_line_1.split()
N = int(fields[0])
A = int(fields[1])
B = int(fields[2])
T = A + B
all = raw_input()
for every in all:
	if every == 'c':
		print 'No'
	elif every == 'a':
		if T > 0:
			T = T - 1
			print 'Yes'
		else:
			print 'No'
	else:
		if T > 0 and B > 0:
			T = T - 1
			B = B - 1
			print 'Yes'
		else:
			print 'No'
N,K = map(int,input().split())

if N == K:
  print(1)
  exit()
elif N % (K-1) != 0:
  print(N//(k-1)+1)
else:   
  print(N//(K-1))

### FIXED CODE ###

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

for g in range(1,N):
  if K+(K-1)*(g-1) >= N:
    print(g)
    exit()
input_str = input()

translate_num = (int("input_str"))**2

print("translate_num\n")

### FIXED CODE ###

input_str = input()

translate_num = (int(input_str))**3

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

### FIXED CODE ###

a, op, b = input().split()
a = int(a)
b = int(b)
if op == '+':
  print(int(a + b))
else:
  print(int(a - b))
#!/usr/bin/env python

import numpy as np

def GCD(a, b):
	dummy1 = max(a, b)
	dummy2 = min(a, b)
	while True:
		dummy = dummy1 % dummy2
		dummy1 = dummy2
		dummy2 = dummy
		if(dummy == 0):
			break

	return dummy1

while True:
	N = input()
	if not N:
		break
	cost = []
	E = []
	root = N * (N - 1) / 2
	for i in range(N):
		S = raw_input().split()
		c1, c2, e1, e2 = list(map(int,S))
		cost.append((c1, c2))
		root -= e1 + e2
		e1 -= 1
		e2 -= 1
		E.append((e1, e2))
	def nums(e):
		N_lst1 = []
		N_lst2 = []
		val_lst1 = []
		val_lst2 = []
		if E[e][0] != -1:
			N_lst1, val_lst1 = nums(E[e][0])
		else:
			N_lst1 = [1]
			val_lst1 = []
		
		if E[e][1] != -1:
			N_lst2, val_lst2 = nums(E[e][1])
		else:
			N_lst2 = [1]
			val_lst2 = []
		
		mul1 = cost[e][0]
		for num in val_lst1:
			mul1 *= num
		mul2 = cost[e][1]
		for num in val_lst2:
			mul2 *= num
		for i in range(len(N_lst1)):
			N_lst1[i] *= mul2
		for i in range(len(N_lst2)):
			N_lst2[i] *= mul1
		
		return N_lst1 + N_lst2, val_lst1 + val_lst2 + [cost[e][0] + cost[e][1]]
	N_lst, v_lst = nums(root - 1)
	#print N_lst
	num_GCD = N_lst[0]
	for num in N_lst:
		num_GCD = GCD(num, num_GCD)
	
	for i in range(len(N_lst)):
		N_lst[i] //= num_GCD
	#print N_lst
	print sum(N_lst)
	


### FIXED CODE ###

#!/usr/bin/env python

def GCD(a, b):
	dummy1 = max(a, b)
	dummy2 = min(a, b)
	while True:
		dummy = dummy1 % dummy2
		dummy1 = dummy2
		dummy2 = dummy
		if(dummy == 0):
			break

	return dummy1

while True:
	N = input()
	if not N:
		break
	cost = []
	E = []
	root = N * (N - 1) / 2
	for i in range(N):
		S = raw_input().split()
		c1, c2, e1, e2 = list(map(int,S))
		cost.append((c1, c2))
		root -= e1 + e2
		e1 -= 1
		e2 -= 1
		E.append((e1, e2))
	def nums(e):
		N_lst1 = []
		N_lst2 = []
		val_lst1 = []
		val_lst2 = []
		if E[e][0] != -1:
			N_lst1, val_lst1 = nums(E[e][0])
		else:
			N_lst1 = [1]
			val_lst1 = []
		
		if E[e][1] != -1:
			N_lst2, val_lst2 = nums(E[e][1])
		else:
			N_lst2 = [1]
			val_lst2 = []
		
		mul1 = cost[e][0]
		for num in val_lst1:
			mul1 *= num
		mul2 = cost[e][1]
		for num in val_lst2:
			mul2 *= num
		for i in range(len(N_lst1)):
			N_lst1[i] *= mul2
		for i in range(len(N_lst2)):
			N_lst2[i] *= mul1
		
		return N_lst1 + N_lst2, val_lst1 + val_lst2 + [cost[e][0] + cost[e][1]]
	N_lst, v_lst = nums(root - 1)
	#print N_lst
	num_GCD = N_lst[0]
	for num in N_lst:
		num_GCD = GCD(num, num_GCD)
	
	for i in range(len(N_lst)):
		N_lst[i] //= num_GCD
	#print N_lst
	print sum(N_lst)
A, B = map(int,input().split())
import math
def lcm(A,B):
    return (A * B) // math.gcd(A, B)
print(lcm(A,B))

### FIXED CODE ###

A, B = map(int,input().split())
import fractions
def lcm(A,B):
    return (A * B) // fractions.gcd(A, B)
print(lcm(A,B))
import sys
import bisect


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n, m = list(map(int, readline().split()))
    a = list(map(int, readline().split()))
    a.sort()
    t = 0
    c = 0
    s = n - 1
    for i in range(a[-1] * 2, a[1] - 1, -1):
        for j in range(s, -1, -1):
            if a[j] * 2 == i:
                c += 1
                t += i
            pl = bisect.bisect_left(a, i - a[j], 0, j)
            pr = bisect.bisect_right(a, i - a[j], 0, j)
            if pl == n:
                break
            elif pr == 0 and j != 0:
                s -= 1
            if pl != pr:
                c += 2 ** (pr - pl)
                t += 2 ** (pr - pl) * i
            if c >= m:
                print(t - (c - m) * i)
                exit()


if __name__ == '__main__':
    solve()


### FIXED CODE ###

import sys
import bisect
import itertools


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n, m = list(map(int, readline().split()))
    a = list(map(int, readline().split()))
    a.sort()
    cor_v = a[0] * 2
    inc_v = a[-1] * 2 + 1
    while - cor_v + inc_v > 1:
        bin_v = (cor_v + inc_v) // 2
        cost = 0
        #条件を満たすcostを全検索
        for i in range(n-1, -1, -1):
            cost += n - bisect.bisect_left(a, bin_v - a[i])
        #costが制約を満たすか
        if cost >= m:
            cor_v = bin_v
        else:
            inc_v = bin_v
    acm = list(itertools.accumulate([0] + a))
    t = 0
    c = 0
    for i in range(n):
        p = bisect.bisect_left(a, cor_v - a[i])
        t += acm[-1] - acm[p] + a[i] * (n - p)
        c += n - p
    print(t - (c - m) * cor_v)


if __name__ == '__main__':
    solve()
S=input()
if S[2]==s[3] and S[4]==s[5]:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

S=input()
if S[2]==S[3] and S[4]==S[5]:
    print('Yes')
else:
    print('No')
import sys
sys.setrecursionlimit(10 ** 6)

n, m = map(int, input().split())
e = [[] for _ in range(n)]

for _ in range(m):
    a, b = map(int, input().split())
    e[a-1].append(b-1)

c = [0] * n
def search_path(p, temp):
    c[p] = 1
    for x in e[p]:
        if x in temp:
            ans = [] + temp[temp.index(x):]
            check = 1
            while check == 1:
                check = 0
                #print(ans)
                for i in range(len(ans)-1):
                    for z in e[ans[i]]:
                        if z == ans[i+1]:
                            continue
                        elif z in ans:
                            t = ans.index(z)
                            if t < i:
                                ans = [] + ans[t:i+1]
                            else:
                                ans = [] + ans[i:t+1]
                            #print(ans, z)
                            check = 1
                            break
                    if check == 1:
                        break
                    else:
                        e[ans[i]] = []
                if check == 1:
                    continue
                for z in e[ans[-1]]:
                    if z == ans[0]:
                        continue
                    elif z in ans:
                        ans = [] + ans[ans.index(z):]
                        check = 1
                        #print(z, ans)
                        break
            print(len(ans))
            for z in ans:
                print(z+1)
            exit()
        else:
            search_path(x, temp + [x])


t = 1
for i in range(n):
    if c[i] == 0:
        ans = search_path(i, [i])

print(-1)

### FIXED CODE ###

n = int(input())

if n % 2 == 0:
    print(0.5)
else:
    print(((n+1)//2)/n)
a, b = [int(i) for i in input().split()]

d = a // b
r = a % b
f = a / b

print("{0} {1} {2:.5f}.format(d, r, f))

### FIXED CODE ###

a, b = [int(i) for i in input().split()]

d = a // b
r = a % b
f = a / b

print("{0} {1} {2:.5f}".format(d, r, f))
import functools
import heapq
import logging
import math
import random
import string
import sys
from argparse import ArgumentParser
from collections import defaultdict
from copy import deepcopy
from typing import Dict, List, Optional, Set, Tuple


def solve(values: List[int], nb: int) -> Optional[int]:
    for _v in values:
        pass
    return nb


def do_job():
    "Do the work"
    LOG.debug("Start working")
    # first line is number of test cases
    N = int(input())
    values = list(map(int, input().split()))
    result = solve(values, N)
    print(result)

do_job()

### FIXED CODE ###

#!/usr/bin/env python3
# vim: set fileencoding=utf-8

# pylint: disable=unused-import, invalid-name, missing-docstring, bad-continuation


"""Module docstring
"""

import functools
import heapq
import logging
import math
import random
import string
import sys
from argparse import ArgumentParser
from collections import defaultdict
from copy import deepcopy


def solve(values, nb):
    cost_to = [0] * nb
    cost_to[1] = abs(values[1] - values[0])
    for i in range(2, nb):
        cost_to[i] = min(
            cost_to[i - 2] + abs(values[i] - values[i - 2]),
            cost_to[i - 1] + abs(values[i] - values[i - 1]),
        )
    return cost_to[nb - 1]


def do_job():
    "Do the work"
    LOG.debug("Start working")
    # first line is number of test cases
    N = int(input())
    values = list(map(int, input().split()))
    result = solve(values, N)
    print(result)


def print_output(testcase, result) -> None:
    "Formats and print result"
    if result is None:
        result = "IMPOSSIBLE"
    print("Case #{}: {}".format(testcase + 1, result))


def configure_log(log_file=None) -> None:
    "Configure the log output"
    log_formatter = logging.Formatter(
        "%(asctime)s - %(filename)s:%(lineno)d - " "%(levelname)s - %(message)s"
    )
    if log_file:
        handler = logging.FileHandler(filename=log_file)
    else:
        handler = logging.StreamHandler(sys.stdout)
    handler.setFormatter(log_formatter)
    LOG.addHandler(handler)


LOG = None
# for interactive call: do not add multiple times the handler
if not LOG:
    LOG = logging.getLogger("template")
    configure_log()


def main(argv=None):
    "Program wrapper."
    if argv is None:
        argv = sys.argv[1:]
    parser = ArgumentParser()
    parser.add_argument(
        "-v",
        "--verbose",
        dest="verbose",
        action="store_true",
        default=False,
        help="run as verbose mode",
    )
    args = parser.parse_args(argv)
    if args.verbose:
        LOG.setLevel(logging.DEBUG)
    do_job()
    return 0


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    sys.exit(main())
import collections
def count_defaultdict(it):
    counter = collections.defaultdict(int)
    for x in it:
        counter[x] += 1
    return dict(counter)
n = int(input())
l = list(map(int, input().split()))
all_sum = 0
count = count_defaultdict(l)
for k, v in count:
    all_sum += v * (v - 1) // 2
for i in range(len(l)):
    if count[l[i]] > 1:
        v = count[l[i]]
        print(all_sum - v * (v-1) // 2 + (v-1) * (v-2)//2)
    else:
        print(all_sum)

### FIXED CODE ###

import collections

def count_defaultdict(it):
    counter = collections.defaultdict(int)
    for x in it:
        counter[x] += 1
    return dict(counter)

_ = int(input())
l = list(map(int, input().split()))
all_sum = 0
count = count_defaultdict(l)
for _, v in count.items():
    all_sum += v * (v - 1) // 2
for i in range(len(l)):
    if count[l[i]] > 1:
        v = count[l[i]]
        print(all_sum - v * (v-1) // 2 + (v-1) * (v-2)//2)
    else:
        print(all_sum)
a,b=input().split()
if a="H":
  print(b)
else:
  if b="H":
    print("D")
  else:
    print("H")


### FIXED CODE ###

a,b=input().split()
if a=="H":
  print(b)
else:
  if b=="H":
    print("D")
  else:
    print("H")
N = input()

print('Yes' if sum(map(int, list(N))) % int(N) == 0 else 'No')

### FIXED CODE ###

k = int(input().replace(' ', '')) ** (1 / 2)
print('Yes' if int(k) == k else 'No')
a, b, c, d, e, k = [int(input()) for in range(6)]


### FIXED CODE ###

a, b, c, d, e, k = [int(input()) for i in range(6)]
print("Yay!" if (e-a)<=k else ":(")
import math
a,b,c=map(int,input().split())
S=[a,b,c]
print(S.count(1))  

### FIXED CODE ###

s=list(input())
count=0
if s[0]=="1":
    count+=1
if s[1]=="1":
    count+=1
if s[2]=="1":
    count+=1
print(count)
#!python3

def LI():
    return list(map(int, input().split()))

# input
N = int(input())
A = LI()

MOD = 10 ** 9 + 7
MAX = 10 ** 5 + 1
fac, finv, inv = [None] * MAX, [None] * MAX, [None] * MAX


def comb_init():
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, MAX):
        fac[i] = fac[i - 1] * i % MOD
        inv[i] = -inv[MOD%i] * int(MOD / i) % MOD
        finv[i] = finv[i - 1] * inv[i] % MOD


def comb(n, k):
    if n < k or n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD


def main():
    comb_init()
    d = {i: [] for i in range(1, N + 1)}
    x, y = [None] * 2
    for i in range(N + 1):
        d[A[i]].append(i)
        if len(d[A[i]]) == 2:
            x, y = d[A[i]]
            break
    
    for i in range(1, N + 2):
        ans = comb(N + 1, i)
        ans -= comb(N + x - y, i - 1)
        ans %= MOD
        print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

#!python3

def LI():
    return list(map(int, input().split()))

# input
N = int(input())
A = LI()

MOD = 10 ** 9 + 7
MAX = 10 ** 5 + 5
fac, finv, inv = [None] * MAX, [None] * MAX, [None] * MAX


def comb_init():
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, MAX):
        fac[i] = fac[i - 1] * i % MOD
        inv[i] = -inv[MOD%i] * int(MOD / i) % MOD
        finv[i] = finv[i - 1] * inv[i] % MOD


def comb(n, k):
    if n < k or n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD


def main():
    comb_init()
    d = {i: [] for i in range(1, N + 1)}
    x, y = [None] * 2
    for i in range(N + 1):
        d[A[i]].append(i)
        if len(d[A[i]]) == 2:
            x, y = d[A[i]]
            break
    
    for i in range(1, N + 2):
        ans = comb(N + 1, i)
        ans -= comb(N + x - y, i - 1)
        ans %= MOD
        print(ans)


if __name__ == "__main__":
    main()
x = int(input())
ans = 0
for b in range(1, x):
    for p in range(2, x):
        if b ** p <= x:
            ans = max(ansm, b**p)

print(ans)

### FIXED CODE ###

x = int(input())
ans = 1
for b in range(1, x):
    for p in range(2, x):
        if b ** p <= x:
            ans = max(ans, b**p)
        else: break

print(ans)