Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

from sys import stdin

a = int(stdin.readline())
A=stdin.readline().split()

product=1
for b in range(0,a):
    product=product*int(A[b])
    if product==0:
        break

if product>10**18:
    product=-1



print(product)

### FIXED CODE ###

from sys import stdin

a = int(stdin.readline())
A=stdin.readline().split()

product=1
K=0

for k in range(0,a):
    if int(A[k])==0:
        product=0
        K=1
        break
        
if K==0:
   for b in range(0,a) :
       product=product*int(A[b])
       if product > 10 ** 18:
          product = -1
          break



print(product)
### BUGGY CODE ###

N = int(input())
L = list(map(int, input().split()))
L.sort()
ret = sum([1 for i in range(0, N-2) for j in range(i+1, N-1) for k in L[j+1:] if L[i]+L[j]>k])
print(ret)

### FIXED CODE ###

from bisect import bisect
N = int(input())
L = list(map(int, input().split()))
L.sort()
ret = 0
for i in range(N-2):
    for j in range(i+1, N-1):
        ret += bisect(L,L[i]+L[j]-1)-j-1
print(ret)
### BUGGY CODE ###

N = int(input())
l = [list(map(int,input().split())) for _ in range(N)]

cnt = 0
for i in l:
    x = 0 if i[0]-i[1] < 0 else i[0]-i[1]
    i[1] = i[0]+i[1]
    i[0] = x
    
l.sort(key=lambda x:x[1])

while l:
    cnt+=1
    x = l.pop(0)
    delete = []
    for i in range(len(l)):
        if x[1] > l[i][0]:
            delete.append(i)

    for i in range(len(delete)):
        l.pop(delete[i]-i)

print(cnt)

### FIXED CODE ###

N = int(input())
l = [list(map(int,input().split())) for _ in range(N)]

ans = N
for i in l:
    x = 0 if i[0]-i[1] < 0 else i[0]-i[1]
    i[1] = i[0]+i[1]
    i[0] = x
    
l.sort(key=lambda x:x[1])

right = 0
for i in range(N):
    if right > l[i][0]:
        ans-=1
    else:
        right = l[i][1]

print(ans)
### BUGGY CODE ###

from scipy.misc import comb


def solve(string):
    n, m, k = map(int, string.split())
    base = n * m * ((n + 1) * (m + 1) * (n + m - 2) - n**2 - m**2 + 2) // 6 % (10**9 + 7)
    return str(base * comb(n * m - 2, min(k - 2, n * m - k), exact=True) % (10**9 + 7))


if __name__ == '__main__':
    print(solve(input()))


### FIXED CODE ###

mod = 10**9 + 7


def comb(n, k):
    x, y = 1, 1
    k = min(k, n - k)
    for i in range(k):
        x *= n - i
        x %= mod
        y *= i + 1
        y %= mod
    return x * pow(y, mod - 2, mod) % mod


def solve(string):
    n, m, k = map(int, string.split())
    base = n * m * ((n + 1) * (m + 1) * (n + m - 2) - n**2 - m**2 + 2) // 6 % mod
    return str(base * comb(n * m - 2, k - 2) % mod)


if __name__ == '__main__':
    print(solve(input()))
### BUGGY CODE ###

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

L = [0] * K
R = [0] * K
for i in range(0, K):
    L[i], R[i] = map(int, input().split())

moves = [0] * N
moves[0] = 1

rui_wa = [0] * N
rui_wa[0] = 1

for i in range(1, N):
    for j in range(0, K):
        l = max(i - L[j], 0)
        r = max(i - R[j], 0)
        if i - L[j] < 0:
            continue

        moves[i] += rui_wa[l] - rui_wa[r - 1]

    rui_wa[i] = moves[i] + rui_wa[i - 1]



print(moves[N - 1] % 998244353)


### FIXED CODE ###

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

L = [0] * K
R = [0] * K
for i in range(0, K):
    L[i], R[i] = map(int, input().split())

moves = [0] * N
moves[0] = 1

rui_wa = [0] * N
rui_wa[0] = 1

for i in range(1, N):
    for j in range(0, K):
        l = max(i - L[j], 0)
        r = max(i - R[j], 0)
        if i - L[j] < 0:
            continue

        moves[i] += (rui_wa[l] - rui_wa[r - 1]) % 998244353

    rui_wa[i] = (moves[i] + rui_wa[i - 1])  % 998244353



print(moves[N - 1] % 998244353)
### BUGGY CODE ###

n = int(input())
s = input()
b = []
for i in range(n):
    if s[i] == '#':
        b.append(i)
if len(b) == 0:
    print(0)
else:
    ans = min(s[b[0]::].count('.'), s.count('#'))
    for i in range(1,len(b)-1):
        ans = min(ans, i+n-b[i]-len(b[i::]))
    print(ans)


### FIXED CODE ###

n = int(input())
s = input()
b = []
for i in range(n):
    if s[i] == '#':
        b.append(i)
if len(b) == 0:
    print(0)
else:
    ans = min(s[b[0]::].count('.'), s.count('#'))
    nb = len(b)
    for i in range(1,len(b)-1):
        ans = min(ans, i + n-b[i]-nb+i)
    print(ans)
### BUGGY CODE ###

n = int(input())

p = [int(input()) for _ in range(n)]


# すでに並んでる列
ordered = []
unordered = []

previous = 0
for i in p:
    if previous < i:
        ordered.append(i)
        previous = i
    else:
        unordered.append(i)
        

count = 0

loopc = len(unordered)
for _ in range(loopc):

    center = ordered[len(ordered)//2]

    # センターに近いものを選択
    t = min(unordered, key=(lambda x: abs(x - center)))


    count += 1
    if center > t:
        for i in ordered:
            if i < t:
                count +=1
            else:
                break
    else:
        for i in reversed(ordered):
            if i > t:
                count +=1
            else:
                break


    unordered.remove(t)
    ordered.append(t)
    ordered.sort()


print(count)




### FIXED CODE ###

n = int(input())

p = [int(input()) for _ in range(n)]


# 連続している最大値を求める

lengths = {}
for pn in p:
    if pn in lengths:
        lengths[pn+1] = lengths[pn] + 1
    else:
        lengths[pn+1] = 1
    
max_count = max(lengths.values())
print(n-max_count)
### BUGGY CODE ###

n = int(input())
a = [int(input()) for _ in range(n)]
ary =[0]
ans = 0
for i in a:
    for j in range(len(ary)):
        ary.append(i+ary[j])
        if (i +ary[j]) % 10 != 0:
            ans = max(ans,i+ary[j])
print(ans)

### FIXED CODE ###

n = int(input())
a = sorted(int(input()) for _ in range(n))
ans = sum(a)
if ans % 10 != 0:
    print(ans)
    exit()
else:
    for i in a:
        if (ans-i) % 10 != 0:
            print(ans-i)
            exit()
    print(0)
### BUGGY CODE ###

from sys import exit, stderr, stdin
input = stdin.readline
# setrecursionlimit(10**7)
MOD = 10**9 + 7

def debug(var, name="hoge"):
    print(name +":" + str(type(var)) + " = " + repr(var), file=stderr)
    return


def main():
    S = list(input()[:-1])[::-1]
    # print(S)
    L = len(S)
    modsum = 0
    # はじめ長さ、つぎは余り
    memo = [[ 0 for __ in range(13)] for _ in range(L)]

    # 0だけ別に
    if S[0].isnumeric():
        memo[0][int(S[0])%13] = 1
    else:
        for n in range(10):
            memo[0][n] = 1

    for i in range(1, L):
        # 数字なら以前までの余りにたす
        if S[i].isnumeric():
            mod = (int(S[i])*pow(10,i))%13
            for m in range(13):
                # 0でない余りを次に持ち越し
                if memo[max(0,i-1)][m] > 0:
                    memo[i][(m+mod)%13] = memo[max(0,i-1)][m]
        # ?なら1~10の余りのケース全てをためす
        else:
            for n in range(10):
                mod = (n*pow(10,i))%13
                for m in range(13):
                    # その前の数があるなら足す
                    if memo[max(0,i-1)][m] > 0:
                        cur = (m+mod)%13
                        memo[i][cur] += memo[max(0,i-1)][m]
                        memo[i][cur] %= MOD
    print(memo[L-1][5])
    # print(memo)








if __name__ == "__main__":
    main()


### FIXED CODE ###

from sys import exit, stderr, stdin
input = stdin.readline


def main():
    MOD = 10**9 + 7
    S = input()[:-1]
    L = len(S)
    # 余り
    memo = [0 for _ in range(13)]
    memo[0] = 1

    for i in range(L):
        memo_prev = [x for x in memo]
        memo = [0 for _ in range(13)]
        # 数字なら以前までの余りにたす
        if S[i].isnumeric():
            n = int(S[i])
            for m in range(13):
                cur = (10*m+n)%13
                memo[cur] += memo_prev[m]
        # ?なら1~10の余りのケース全てをためす
        else:
            for n in range(10):
                for m in range(13):
                    cur = (10*m+n)%13
                    memo[cur] += memo_prev[m]
            for m in range(13):
                memo[m] %= MOD
    print(memo[5])


if __name__ == "__main__":
    main()
### BUGGY CODE ###

import functools


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


def sub():
    N, As = [input() for _ in range(2)]
    N = int(N)
    As = [int(e) for e in As.split(" ")]
    As = sorted(As, reverse=True)

    memG = 0
    for i in range(N):
        tmp = As[:i] + As[i + 1 :]
        g = functools.reduce(gcd, tmp)
        if g > memG:
            memG = g
    print("{}".format(memG))


sub()

### FIXED CODE ###

from functools import lru_cache, reduce


@lru_cache(maxsize=None)
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


def sub():
    N, As = [input() for _ in range(2)]
    N = int(N)
    As = [int(e) for e in As.split(" ")]
    # As = sorted(As, reverse=True)

    memG = 0
    # if N == 2:
    # memG = gcd(As[0], As[1])
    if N < 10:
        for i in range(N):
            tmp = As[:i] + As[i + 1 :]
            g = reduce(gcd, tmp)
            if g > memG:
                memG = g
    else:
        gLeft = {0: As[0], 1: gcd(As[0], As[1])}
        for i in range(2, N):
            gI = gcd(gLeft[i - 1], As[i])
            gLeft[i] = gI
        gRight = {N - 1: As[N - 1], N - 2: gcd(As[N - 1], As[N - 2])}
        for i in range(2, N):
            gI = gcd(gRight[N - i], As[N - 1 - i])
            gRight[N - 1 - i] = gI

        buf = []
        for i in range(N):
            leftG = None
            if (i - 1) in gLeft:
                leftG = gLeft[i - 1]
            rightG = None
            if (i + 1) in gRight:
                rightG = gRight[i + 1]
            # tmpG = None
            if leftG is None:
                leftG = rightG
            elif rightG is None:
                rightG = leftG
            buf.append(gcd(leftG, rightG))
            # tmpG = gcd(leftG, rightG)
            # if tmpG > memG:
            #     memG = tmpG
        memG = max(buf)

    print("{}".format(memG))


sub()
### BUGGY CODE ###

n=int(input())
s=input()
ans=0

for i in range(n):
  Z=[0]*n
  j=i+1
  while j<n:
    k=0
    while i+k<j and j+k<n and s[i+k]==s[j+k]:
      k+=1
      Z[j]=k
    j+=max(k,1)
  ans=max(ans,max(Z))
print(ans)

### FIXED CODE ###

def main():
  n=int(input())
  s=input()
  dp=[[0]*(n+1) for i in range(n+1)]
  for i in range(n-1,-1,-1):
    for j in range(n-1,i,-1):
      if s[i]==s[j]:
        dp[i][j]=dp[i+1][j+1]+1
  #for i in dp:
  #  print(i)
  
  ans=0
  for i in range(n-1):
    for j in range(i+1,n):
      ans=max(ans,min(j-i,dp[i][j]))
  print(ans)      
        

if __name__=='__main__':
  main()
### BUGGY CODE ###

N=int(input())
A = [int(input()) for i in range(N)]
import bisect



mina = [A[0]]

# print(mina)
# ans = 
for i in range(1,N):
    # print(mina)
    if mina[0]>=A[i]:
        ind = bisect.bisect_left(mina,A[i])
        mina.insert(ind,A[i])
        # ans +=1 
    else:
        ind = bisect.bisect_left(mina,A[i])
        mina.insert(ind,A[i])
        if ind == len(mina)-1:
            
            del(mina[-2])
        else:
            # print("a")
            del(mina[ind-1])


# print(mina)
    
print(len(mina))


### FIXED CODE ###

N = int(input())
A = [int(input()) for i in range(N)]

import bisect

bilist = [A[0]]
ans = 0

for a in A[1:]:
    index = bisect.bisect_left(bilist,a)
    if index == 0:
        bisect.insort_left(bilist,a)
    else:
        bilist[index-1] = a


print(len(bilist))
### BUGGY CODE ###

import random
N=int(input())
A=[int(i) for i in input().split()]
B=[int(i) for i in input().split()]
a=[0 for i in range(N+1)]
b=[0 for i in range(N+1)]
for i in range(N):
    a[A[i]]+=1
    b[B[i]]+=1
if max([a[i]+b[i] for i in range(1,N+1)])<=N:
    print("Yes")
else:
    print("No")
    exit()
B.sort(key=lambda x: random.random())
point=0
for i in range(N):
    if A[i]==B[i]:
        point+=1
while(point>0):
    x=random.randrange(N)
    y=random.randrange(N)
    if x==y:
        continue
    before=0
    after=0
    if A[x]==B[x]:
        before+=1
    if A[y]==B[y]:
        before+=1
    if A[x]==B[y]:
        after+=1
    if A[y]==B[x]:
        after+=1
    if before>after:
        B[x],B[y]=B[y],B[x]
        point=point+after-before
print(*B)


### FIXED CODE ###

import random
N=int(input())
A=[int(i) for i in input().split()]
B=[int(i) for i in input().split()]
a=[0 for i in range(N+1)]
b=[0 for i in range(N+1)]
for i in range(N):
    a[A[i]]+=1
    b[B[i]]+=1
if max([a[i]+b[i] for i in range(1,N+1)])<=N:
    print("Yes")
else:
    print("No")
    exit()
B=B[::-1]
point=0
for i in range(N):
    if A[i]==B[i]:
        point+=1
while(point>0):
    x=random.randrange(N)
    y=random.randrange(N)
    if x==y:
        continue
    before=0
    after=0
    if A[x]==B[x]:
        before+=1
    if A[y]==B[y]:
        before+=1
    if A[x]==B[y]:
        after+=1
    if A[y]==B[x]:
        after+=1
    if before>after:
        B[x],B[y]=B[y],B[x]
        point=point+after-before
print(*B)
### BUGGY CODE ###

from itertools import combinations

N = int(raw_input())
L = map(int, raw_input().split())


def number_of_triangles():
    if N < 3:
        return 0
    result = 0
    for a, b, c in combinations(L, 3):
        if a < b + c and b < c + a and c < a + b:
            result += 1
    return result

print number_of_triangles()


### FIXED CODE ###

from bisect import bisect_left

N = int(raw_input())
L = map(int, raw_input().split())

L.sort()
result = 0
for i in xrange(N-2):
    a = L[i]
    for j in xrange(i+1, N-1):
        b = L[j]
        k = bisect_left(L, a + b, j + 1)
        result += k - (j + 1)
print result
### BUGGY CODE ###

import heapq

N, M = map(int, input().split())
jobs = [list(map(int, input().split())) for _ in range(N)]

ans = 0
hq = []
for day in range(1, M+1):
    for job in jobs:
        if day == job[0]:
            heapq.heappush(hq, - job[1])
    if len(hq) > 0:
        ans -= heapq.heappop(hq)

print(ans)


### FIXED CODE ###

import heapq
from collections import defaultdict

N, M = map(int, input().split())
jobs = defaultdict(list)
for _ in range(N):
    day, value = map(int, input().split())
    if day <= M:
        jobs[day].append(value)

ans = 0
hq = []
for day in range(1, M+1):
    for value in jobs[day]:
        heapq.heappush(hq, - value)
    if len(hq) > 0:
        ans -= heapq.heappop(hq)

print(ans)
### BUGGY CODE ###

import sys
from collections import deque


data = sys.stdin.readlines()
N, M = map(int, data[0].split())
edge = [[] for _ in range(N)]
for i in range(1, M + 1):
    u, v = map(int, data[i].split())
    u -= 1
    v -= 1
    edge[u].append(v)
S, T = map(lambda x: int(x) - 1, data[M + 1].split())


def bfs1(s):
    q = deque()
    q.append((s, 0))

    while len(q) > 0:
        v, step = q.popleft()
        if step == 3:
            edge3[s].append(v)
        else:
            for nv in edge[v]:
                q.append((nv, step + 1))


def bfs2(n):
    global T
    q = deque()
    status[n] = 0
    q.append(n)

    while len(q) > 0:
        v = q.popleft()
        for nv in edge3[v]:
            if status[nv] == -1:
                status[nv] = status[v] + 1
                q.append(nv)


edge3 = [[] for _ in range(N)]
for i in range(N):
    bfs1(i)


status = [-1] * N
status[S] = 0
bfs2(S)
print(status[T])


### FIXED CODE ###

import sys
from collections import deque


data = sys.stdin.readlines()
N, M = map(int, data[0].split())
edge = [[] for _ in range(N)]
for i in range(1, M + 1):
    u, v = map(int, data[i].split())
    u -= 1
    v -= 1
    edge[u].append(v)
S, T = map(lambda x: int(x) - 1, data[M + 1].split())

visited = set()
q = deque()
q.append((0, S))
ans = 10 ** 10
while len(q) > 0:
    c, v = q.popleft()
    key = (c % 3, v)
    if key in visited:
        continue
    visited.add(key)
    if v == T and c % 3 == 0:
        ans = min(ans, c // 3)
    else:
        for e in edge[v]:
            newKey = (c + 1, e)
            q.append(newKey)

if ans == 10 ** 10:
    print(-1)
else:
    print(ans)
### BUGGY CODE ###

import bisect
def justM(x,N):
    sum_=0
    for i in range(N):
        b=bisect.bisect_left(A,x-A[i])
        sum_+=N-b
    return sum_

N,M=map(int,input().split())
A=sorted(map(int,input().split()))
left,right=-1,10**20
while(right-left>1):
    mid=(right+left)//2
    s=justM(mid,N)
    if s<M:
        right=mid
    else:
        left=mid
D=left
r=[0]*(N+1)
ans=0
for i in range(N):
    r[i+1]=r[i]+A[i]
cnt=0
for i in range(N):
    b=bisect.bisect_left(A,D-A[i])
    ans+=A[i]*(N-b)
    cnt+=N-b
    ans+=r[N]-r[b]
print(ans-D*(cnt-M))

### FIXED CODE ###

import bisect
def justM(x,N):
    sum_=0
    for i in range(N):
        b=bisect.bisect_left(A,x-A[i])
        sum_+=N-b
    return sum_

N,M=map(int,input().split())
A=sorted(map(int,input().split()))
left,right=-1,(10**5)*2+1
while(right-left>1):
    mid=(right+left)//2
    s=justM(mid,N)
    if s<M:
        right=mid
    else:
        left=mid
D=left
r=[0]*(N+1)
ans=0
for i in range(N):
    r[i+1]=r[i]+A[i]
cnt=0
for i in range(N):
    b=bisect.bisect_left(A,D-A[i])
    ans+=A[i]*(N-b)+(r[N]-r[b])
    cnt+=N-b
print(ans-D*(cnt-M))
### BUGGY CODE ###

N, X = map(int, input().split())
x = sorted(map(lambda s: abs(int(s) - X), input().split()))
x = x[0:1] + [x[i] for i in range(1, len(x)) if x[i] != x[i-1]]

for d in range(x[0], 1, -1):
    for xi in x:
        if xi % d != 0:
            break
    else:
        print(d)
        exit()
print(1)

### FIXED CODE ###

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


N, X = map(int, input().split())
x = list(map(lambda s: abs(int(s) - X), input().split()))

if len(x) < 2:
    print(x[0])
    exit()
d = gcd(x[0], x[1])

for i in range(2, len(x)):
    d = gcd(d, x[i])
print(d)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

N=int(input())
for n in range(1,N+1):
    ans=0
    for i in range(1,int(n**0.5)+1):
        for j in range(1,int(n**0.5)+1):
            for k in range(1,int(n**0.5)+1):
                if i**2+j**2+k**2+i*j+j*k+k*i==n:
                    ans+=1
    print(ans)

### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

N=int(input())
ans=[0]*10**6
for i in range(1,int(N**0.5)+1):
    for j in range(1,int(N**0.5)+1):
        for k in range(1,int(N**0.5)+1):
            tmp=i**2+j**2+k**2+i*j+j*k+k*i
            ans[tmp]+=1
for i in range(1,N+1):
    print(ans[i])
### BUGGY CODE ###

N, Q = map(int, input().strip().split(' '))
S = input()
l = [0] * Q
r = [0] * Q
for i in range(Q):
    l[i], r[i] = map(int, input().strip().split(' '))


for i in range(Q):
    print(S[(l[i]-1):(r[i])].count('AC'))


### FIXED CODE ###

# 入力
N, Q = map(int, input().strip().split())
S = input()
l = [0] * Q
r = [0] * Q
for i in range(Q):
    l[i], r[i] = map(int, input().strip().split())

# 累積和
cum_sum = [0] * N
for i in range(N):
    if i == 0:
        cum_sum[i] = 0
    elif S[i - 1] == 'A' and S[i] == 'C':
        cum_sum[i] = cum_sum[i - 1] + 1
    else:
        cum_sum[i] = cum_sum[i - 1]

for i in range(Q):
    print(cum_sum[r[i] - 1] - cum_sum[l[i] - 1])
### BUGGY CODE ###

s = input()
lst =[]
start = 0
for i in range(len(s) - 1):
	if s[i] == 'L' and s[i + 1] == 'R':
		lst.append(s[start:i + 1])
		start = i + 1
lst.append(s[start:])

def gather_points(rl_string):
	boundary = 0
	ln = len(rl_string)
	for i, s in enumerate(rl_string):
		if s == 'L':
			boundary = i
			break
	evens = (ln + 1) // 2
	odds =  ln // 2
	lst = [0 for _ in range(ln)]
	lst[i - 1] = evens if i % 2 else odds
	lst[i] = odds if i % 2 else evens
	return lst
	
gp = sum([gather_points(l) for l in lst], [])
print(' '.join([str(i) for i in gp]))


		
		


### FIXED CODE ###

s = input()
gp = []
boundary = [0]
ln = len(s)
for i in range(ln - 1):
	ss = s[i:i + 2]
	if ss == 'RL':
		gp.append(i + 1)
	if ss == 'LR':
		boundary.append(i + 1)
boundary.append(ln)
ans = []
group = 0
for i in range(ln):
	if i != gp[group]:
		ans.append('0')
		if i == boundary[group + 1]:
			group += 1
		continue
	gl = boundary[group + 1] - boundary[group]
	evens = (gl + 1) // 2
	odds =  gl // 2
	ans[i - 1] = str(evens if (i - boundary[group]) % 2 else odds)
	ans.append(str(odds if (i - boundary[group]) % 2 else evens))
print(' '.join(ans))
### BUGGY CODE ###

n, p = map(int, input().split())
if n == 1 or p== 1:
    print(p)
    exit()
c2 = 0
while p%2 == 0:
    c2 += 1
    p//=2
c = 2**(c2//n)
max = 1
i = 1
while i**n <= p:
    if p%(i**n) == 0:
        max = i
    i += 1
print(c*max)

### FIXED CODE ###

n, p = map(int, input().split())
if n == 1 or p== 1:
    print(p)
    exit()
c2 = 0
while p%2 == 0:
    c2 += 1
    p//=2
c = 2**(c2//n)
i = int(p**(1/n))+1
if i%2 == 0:
    i -= 1
while i > 1:
    if p%(i**n) == 0:
        print(c*i)
        exit()
    else:
        i -= 2
print(c)
### BUGGY CODE ###

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

for i in range(N):
    A[i] = [A[i],i]
    #A[i][0]:number,A[i][1]:index

A.sort(reverse = True)

sum = A[0][0]
index = [A[0][1]]
cnt = 1

for i in range(1,N):
    if A[i][1]+1 not in index and A[i][1]-1 not in index:
        sum += A[i][0]
        index.append(A[i][1])
        cnt += 1
        if cnt == N//2:
            break

print(sum)


### FIXED CODE ###

from collections import defaultdict

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

DP = defaultdict(lambda: -10**18)

DP[(0,0)] = A[0]

for i in range(1,N):
    for j in range((i+1)//2-1,(i+2)//2):
        if j == 0:
            DP[(i,0)] = max(DP[(i-1,0)],A[i])
        else:
            DP[(i,j)] = max(DP[(i-1,j)],DP[(i-2,j-1)]+A[i])

print(DP[(N-1,N//2-1)])
### BUGGY CODE ###

def main():
    n, m = map(int, input().split())
    a, b = [], []
    to_n = []
    for _ in range(m):
        x, y = map(int, input().split())
        a.append(x)
        b.append(y)
        if y == n:
            to_n.append(x)

    for j in range(m):
        if a[j] == 1:
            if b[j] in to_n:
                return 'POSSIBLE'
    return 'IMPOSSIBLE'


print(main())

### FIXED CODE ###

def main():
    n, m = map(int, input().split())
    a, b = [], []
    from_1 = set()
    to_n = set()
    for _ in range(m):
        x, y = map(int, input().split())
        if x == 1:
            from_1.add(y)
            continue
        if y == n:
            to_n.add(x)
            continue
    ans = from_1 & to_n
    if ans:
        return "POSSIBLE"

    return 'IMPOSSIBLE'


print(main())
### BUGGY CODE ###

arr = input().split()
arr = list(map(int,arr))
a = arr[0]
b = arr[1]
x = arr[2]

c = a
left = 0
while(True):
    if c % x == 0:
        left = c
        break
    else:
        c += 1

c = b
while(True):
    if c % x == 0:
        right = c
        break
    else:
        c -= 1

print((right - left) // x + 1)


### FIXED CODE ###

arr = input().split()
arr = list(map(int,arr))
a = arr[0]
b = arr[1]
x = arr[2]

def f(n):
    if n == -1:
        return 0
    else:
        return n // x + 1

print(f(b) - f(a-1))