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

import sys

sys.setrecursionlimit(10**6)

def solve(n,a):
    wa=0
    for i in range(n):
        if(i%2==0):
            wa+=a[i]
    kotae=wa
    for i in range(n//2):
        wa+=a[(n//2-i-1)*2+1]
        wa-=a[(n//2-i-1)*2]
        if(wa>kotae):
            kotae=wa
    return kotae

def dfs(n,a,k):
    if(k==1):
        return max(a)
    ari=a[n-1]+dfs(n-2,a[:n-2],k-1)
    if(n==k*2-1):
        return ari
    nasi=dfs(n-1,a[:n-1],k)
    return max(ari,nasi)

n=int(input())

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


print(dfs(n,a,n//2))


### FIXED CODE ###

import sys

sys.setrecursionlimit(10**6)

def solve(n,a):
    wa=0
    for i in range(n):
        if(i%2==0):
            wa+=a[i]
    kotae=wa
    for i in range(n//2):
        wa+=a[(n//2-i-1)*2+1]
        wa-=a[(n//2-i-1)*2]
        if(wa>kotae):
            kotae=wa
    return kotae

def dfs(n,a,k):
    global zen
    zen.append([n,k])
    if(k==1):
        return max(a)
    ari=a[n-1]+dfs(n-2,a[:n-2],k-1)
    if(n==k*2-1):
        return ari
    nasi=dfs(n-1,a[:n-1],k)
    return max(ari,nasi)

n=int(input())

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

if(n%2==0):
    print(solve(n,a))
else:
    data=[[a[0],a[0]],[max(a[:2]),max(a[:2])]]
    #data.append([max(a[:3]),sum(a[:3])-min(a[:3])])
    data.append([max(a[:3]),a[0]+a[2]])
    for i in range(3,n):
        if(i%2==1):
            ari=a[i]+data[i-2][0]
            nasi=data[i-1][1]
            saiyo=max(ari,nasi)
            data.append([saiyo,saiyo])
        else:
            ooi=a[i]+data[i-2][1]
            nasi=data[i-1][1]
            ari=a[i]+data[i-2][0]
            sukunai=max(ari,nasi)
            data.append([sukunai,ooi])
    print(data[n-1][0])
### BUGGY CODE ###

n,m = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(n)]
ab.sort()
ans = 0
a = []
for i in range(1,m+1):
  for j in range(len(ab)):
    if ab[j][0] <= i:
      a.append(ab[j])
  a.sort(key=lambda x:x[1])
  if a == []:
    continue
  else:
    x = a.pop()
  ab.remove(x)
  ans += x[1]
  a = []
print(ans)

### FIXED CODE ###

import heapq
n,m = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(n)]
ab.sort()
queue = []
flag = 0
heapq.heapify(queue)
ans = 0
for i in range(1,m+1):
  for j in range(flag,n):
    if ab[j][0] <= i:
      heapq.heappush(queue,-ab[j][1])
      flag += 1
    else:
      break
  if queue != []:
    k = heapq.heappop(queue)
    ans += k
print(-ans)
### BUGGY CODE ###

N, P = map(int, input().split())
S = input()

a = [0] * (N + 1)
r = [0] * (N+1)

if P != 2 and P != 5:
    tenfactor=1
    for i in range(1,N+1):
        a[i] = (int(S[N-i])*tenfactor+a[i-1])
        tenfactor*=10
        r[i]=a[i]%P

    ans = 0
    from collections import Counter
    C=Counter(r)
    for v,i in C.items():
        ans += (i * (i - 1) // 2)
elif P == 2:
    ans = 0
    for i in range(N):
        if int(S[i]) % 2 == 0:
            ans += i + 1
elif P == 5:
    ans = 0
    for i in range(N):
        if int(S[i]) == 0 or int(S[i]) == 5:
            ans += i + 1

print(ans)



### FIXED CODE ###

N, P = map(int, input().split())
S = input()

a = [0] * (N + 1)

if P != 2 and P != 5:
    tenfactor=1
    for i in range(1,N+1):
        a[i] = ((int(S[N-i])*tenfactor+a[i-1])%P)
        tenfactor*=10
        tenfactor%=P

    ans = 0
    from collections import Counter
    C=Counter(a)
    for v,i in C.items():
        ans += (i * (i - 1) // 2)
elif P == 2:
    ans = 0
    for i in range(N):
        if int(S[i]) % 2 == 0:
            ans += i + 1
elif P == 5:
    ans = 0
    for i in range(N):
        if int(S[i]) == 0 or int(S[i]) == 5:
            ans += i + 1

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

from itertools import accumulate

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

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

for j in range(k):
    if j > 41:
        break

    b = [0] * n

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

    a = list(accumulate(b))

print(*a)

### FIXED CODE ###

from itertools import accumulate

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

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

for j in range(k):
    if j > 41:
        break

    b = [0] * n

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

    a = list(accumulate(b))

print(*a)
### BUGGY CODE ###

#bfs2-AGC033A
h,w=map(int,input().split())
s=[input() for _ in range(h)]

sxy=[]
for i in range(h):
    for j in range(w):
        if s[i][j]=="#":
            sxy.append([0,i,j])
ddx=[1,-1,0,0]
ddy=[0,0,1,-1]

inf=float("inf")
 
t=[[inf for _ in range(w)] for _ in range(h)]
q=[]
for txy in sxy:
    q.append(txy)
    t[txy[1]][txy[2]]=0

while q:
    d,y,x=q.pop(0)
    for (dx,dy) in zip(ddx,ddy):
        ny=y+dy
        nx=x+dx
        if not (0<=nx<w and 0<=ny<h):continue
        if t[ny][nx]==inf and t[ny][nx]>t[y][x]+1:
            t[ny][nx]=t[y][x]+1
            q.append([d+1,ny,nx])
a=0
for res in t:
    a=max(a,max(res))
print(a)

### FIXED CODE ###

#bfs2-AGC033A
h,w=map(int,input().split())
s=[input() for _ in range(h)]

from collections import deque

sxy=[]
for i in range(h):
    for j in range(w):
        if s[i][j]=="#":
            sxy.append([i,j])
ddx=[1,-1,0,0]
ddy=[0,0,1,-1]

t=[[-1 for _ in range(w)] for _ in range(h)]
q=deque()
for txy in sxy:
    q.append(txy)
    t[txy[0]][txy[1]]=0

count=0
while q:
    y,x=q.popleft()
    count+=1
    for (dx,dy) in zip(ddx,ddy):
        ny=y+dy
        nx=x+dx
        if not (0<=nx<w and 0<=ny<h):continue
        if t[ny][nx]==-1:
            t[ny][nx]=t[y][x]+1
            q.append([ny,nx])
a=0
for i in range(h):
    for j in range(w):
        a=max(a,t[i][j])
print(a)
### BUGGY CODE ###

#python3

def main():
    n, w = map(int, input().split())
    weight = [0 for _ in range(110)]
    value = [0 for _ in range(110)]

    for i in range(n):
        x, y = map(int, input().split())
        weight[i] = x
        value[i] = y

    
    dp = [[0 for _ in range(110000)] for i in range(110)]

    for i in range(n):
        for sum_w in range(w+1):
            if sum_w - weight[i] >= 0:
                dp[i+1][sum_w] = max(dp[i+1][sum_w], dp[i][sum_w - weight[i]] + value[i])
            
            dp[i+1][sum_w] = max(dp[i+1][sum_w], dp[i][sum_w])

    print(dp[n][w]) 

main()

### FIXED CODE ###


def main():
    n, w = map(int, input().split())
    weight = [0 for _ in range(110)]
    value = [0 for _ in range(110)]

    for i in range(n):
        x, y = map(int, input().split())
        weight[i] = x
        value[i] = y

    
    dp = [[0 for _ in range(110000)] for i in range(110)]

    for i in range(n):
        for sum_w in range(w+1):
            if sum_w - weight[i] >= 0:
                dp[i+1][sum_w] = max(dp[i+1][sum_w], dp[i][sum_w - weight[i]] + value[i])
            
            dp[i+1][sum_w] = max(dp[i+1][sum_w], dp[i][sum_w])

    print(dp[n][w]) 

main()
### BUGGY CODE ###

# -*- coding: utf-8 -*-
# E

import sys
from collections import defaultdict, deque
from heapq import heappush, heappop
import math
import bisect

# 再起回数上限変更
# sys.setrecursionlimit(1000000)

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

A.sort(reverse=True)
F.sort()
q = []


for i in range(N):
    heappush(q, (-A[i]*F[i], A[i], F[i]))

for k in range(K):
    val, a, f = heappop(q)
    if a == 0:
        print(-val)
        sys.exit()
    else:
        a -= 1
        heappush(q, (-a*f, a, f))

val, a, f = heappop(q)
print(-val)






### FIXED CODE ###

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

A.sort(reverse=True)
F.sort()


def judge(x):
    val = 0
    for i in range(N):
        val += max(A[i] - x // F[i], 0)
        if val > K:
            return False
    if val <= K:
        return True


ub = 10**12
lb = -1

while lb + 1 < ub:
    x = (ub+lb)/2
    if judge(x):
        ub = x
    else:
        lb = x

print(int(ub))
### BUGGY CODE ###

from collections import Counter
import sys

input=sys.stdin.readline
n=int(input())
l=[input() for i in range(n)]
c=Counter(l)
max_list=[kv[0] for kv in c.items() if kv[1]==max(c.values())]
max_list.sort()
for j in max_list:
  print(j.strip())

### FIXED CODE ###

n = int(input())
s = [input() for _ in range(n)]
d = {}
for w in s:
    if w not in d:
        d[w] = 0
    d[w] += 1
d2 = sorted(d.items(), key=lambda x:x[1], reverse=True)
maxcnts = [w[0] for w in d2 if w[1] == d2[0][1]]
maxcnts.sort()
for ans in maxcnts:
    print(ans)
### BUGGY CODE ###

all_num, select_num = map(int, input().split())
dice = [int(a) for a in input().split()]
max_sum = 0

for i in range(all_num - (select_num - 1)):
    #this_sum = 0
    select_list = []
    for s in range(select_num):
        #this_sum += dice[i+s]
        select_list.append(dice[i+s])

    this_sum = sum(select_list)
 
    if this_sum > max_sum:
        max_sum = this_sum

print((max_sum + select_num) * 0.5)

### FIXED CODE ###

all_num, select_num = map(int, input().split())
dice = [int(a) for a in input().split()]

for i in range(all_num - (select_num - 1)):
    if i == 0:
        max_sum = this_sum = sum(dice[i:(i + select_num)])
    else:
        this_sum = this_sum - dice[i - 1] + dice[i + select_num - 1]

        if this_sum > max_sum:
            max_sum = this_sum

print((max_sum + select_num) * 0.5)
### BUGGY CODE ###

import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, A, B = map(int, sys.stdin.readline().split())

    ret = 0
    tmp = 0
    while True:
        for a in range(A):
            if(tmp == N):
                break
            ret += 1
            tmp += 1

        for b in range(B):
            if(tmp == N):
                break
            tmp += 1

        if (tmp == N):
            break


    print(ret)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, A, B = map(int, sys.stdin.readline().split())

    ret = 0
    cnt = N // (A + B)

    if N % (A + B) == 0:
        print(int(A * cnt))
    elif N < A + B:
        print(min(N, A))
    else:
        ret += A*cnt
        if N - (A+B)*cnt <= A:
            ret += N - (A+B)*cnt
        else:
            ret += A

        print(ret)


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

import itertools
from sys import stdin
N=int(input())
st=list(stdin.readline().strip())
count=0
cnt=0
num=["0","1","2","3","4","5","6","7","8","9"]

num_list= ["".join(i) for i in itertools.product(num,repeat=3)]
for number in num_list:
    mark = 0
    for i in range(N):
        if cnt==0 and number[0]==st[i]:
            mark=i
            cnt+=1
            continue
        if cnt==1 and number[1]==st[i] and i>mark:
            cnt+=1
            mark=i
            continue
        if cnt==2 and number[2]==st[i] and i>mark:
            cnt+=1
            break
    if cnt==3:
        count+=1
    cnt=0
print(count)

### FIXED CODE ###

def main():
  N = int(input())
  S = list(map(int,input()))
  ans = 0
  for i in range(10):
    for j in range(10):
      for k in range(10):
        flg = False
        flg2 = False
        for x in range(N):
          if flg2:
            break
          if not flg:
            if S[x] == i:
              flg = True
          else:
            if S[x] == j:
              flg2 = True
              if k in S[x+1:]:
                ans +=1
  print(ans)
main()
### BUGGY CODE ###

a, b, x  = list(map(int, input().split()))
o = len([i for i in range(a, b+1) if i%x == 0])
print(o)

### FIXED CODE ###

a, b, x  = list(map(int, input().split()))
print(b//x - (a-1)//x)
### BUGGY CODE ###

import bisect
N = int(input())
a = list(map(int, input().split()))

s = [0, N+1]
order = [0]*(N+1)

for i in range(N):
    order[a[i]] = i+1

ans = 0
for i in range(1, N+1):
    bisect.insort_left(s, order[i])
    ans += i*(order[i]-s[bisect.bisect_left(s, order[i])-1]) * \
        (s[bisect.bisect_left(s, order[i])+1]-order[i])
print(ans)


### FIXED CODE ###

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

order = [0]*(N+1)

for i in range(N):
    order[a[i]] = i

ans = 0
checkR = list(range(N+1))
checkL = list(range(N+1))

for i in range(N, 0, -1):
    ans += i*(order[i] - checkR[order[i]] + 1)*(checkL[order[i]] - order[i]+1)
    checkR[checkL[order[i]]+1] = checkR[order[i]]
    checkL[checkR[order[i]]-1] = checkL[order[i]]
print(ans)
### BUGGY CODE ###

import numpy as np
from scipy.ndimage.interpolation import shift as scipy_shift

class shift:
    def __init__(self,a):
        self.arr = a
        self.height = a.shape[0]
        self.width = a.shape[1]
    def shifted(self,down,right):
        temp1 = self.arr[list(np.linspace(-down, -down + self.height - 1, self.height).astype(np.int32) % self.height), :]
        temp2 = temp1[:, list(np.linspace(-right, -right + self.width - 1, self.width).astype(np.int32) % self.width)]
        return temp2
    def shifted_zero(self,down,right):
        index_vertical = np.arange(self.height)
        index_horizontal = np.arange(self.width)
        temp1 = self.arr[list(scipy_shift(index_vertical, down, output = int, mode = 'constant')),:]
        temp2 = temp1[:,list(scipy_shift(index_horizontal, right, output = int, mode = 'constant'))]
        return temp2
    def is_sym(self,down,right):
        temp = self.shifted(down,right)
        delta = temp - temp.T
        return(not (delta*delta).sum())



N = int(input())
array = [list(input()) for i in range(N)]
array_int = np.array([[ord(i) for i in j] for j in array])

count = np.array([[shift(array_int).is_sym(i,j) for i in range(N)] for j in range(N)])
print(count.sum())

### FIXED CODE ###

import numpy as np
from scipy.ndimage.interpolation import shift as scipy_shift

class shift:
    def __init__(self,a):
        self.arr = a
        self.height = a.shape[0]
        self.width = a.shape[1]
    def shifted(self,down,right):
        temp1 = self.arr[list(np.linspace(-down, -down + self.height - 1, self.height).astype(np.int32) % self.height), :]
        temp2 = temp1[:, list(np.linspace(-right, -right + self.width - 1, self.width).astype(np.int32) % self.width)]
        return temp2
    def shifted_zero(self,down,right):
        index_vertical = np.arange(self.height)
        index_horizontal = np.arange(self.width)
        temp1 = self.arr[list(scipy_shift(index_vertical, down, output = int, mode = 'constant')),:]
        temp2 = temp1[:,list(scipy_shift(index_horizontal, right, output = int, mode = 'constant'))]
        return temp2
    def is_sym(self,down,right):
        temp = self.shifted(down,right)
        delta = temp - temp.T
        return(not (delta*delta).sum())



N = int(input())
array = [list(input()) for i in range(N)]
array_int = np.array([[ord(i) for i in j] for j in array])

if N >= 2:
    count = np.array([shift(array_int).is_sym(0,i)*(N-i) for i in range(N)]).sum() + np.array([shift(array_int).is_sym(i,0)*(N-i) for i in range(1,N)]).sum()
else:
    count =  int(shift(array_int).is_sym(0,0))
print(count)
### BUGGY CODE ###

import queue
N,X,Y=map(int,input().split())

count=[0]*N

def bfs(start):
    dist=[-1]*(N+1)#indexと頂点の番号を合わせる
    q=queue.Queue()
    q.put([start,0])
    dist[start]=0
    while not q.empty():
        j,kyori=q.get()

        if j-1>=1:
            if dist[j-1]==-1:
                q.put([j-1,kyori+1])
                dist[j-1]=kyori+1

        if j+1<=N:
            if dist[j+1]==-1:
                q.put([j+1,kyori+1])
                dist[j+1]=kyori+1
        
        if j == X and dist[Y]==-1:
            q.put([Y,kyori+1])
            dist[Y]=kyori+1

        if j == Y and dist[X]==-1:
            q.put([X,kyori+1])
            dist[X]=kyori+1

    return dist[1:]

def main():
    for start in range(1,N+1):
        dist=bfs(start)
        for d in dist:
            count[d]+=1

    for i in count[1:]:
        print(i//2)

main()

### FIXED CODE ###

from collections import deque
N,X,Y=map(int,input().split())

count=[0]*N

def bfs(start):
    dist=[-1]*(N+1)#indexと頂点の番号を合わせる
    q=deque()
    q.append([start,0])
    dist[start]=0
    while q:
        j,kyori=q.popleft()

        if j-1>=1:
            if dist[j-1]==-1:
                q.append([j-1,kyori+1])
                dist[j-1]=kyori+1

        if j+1<=N:
            if dist[j+1]==-1:
                q.append([j+1,kyori+1])
                dist[j+1]=kyori+1
        
        if j == X and dist[Y]==-1:
            q.append([Y,kyori+1])
            dist[Y]=kyori+1

        if j == Y and dist[X]==-1:
            q.append([X,kyori+1])
            dist[X]=kyori+1

    return dist[1:]

def main():
    for start in range(1,N+1):
        dist=bfs(start)
        for d in dist:
            count[d]+=1

    for i in count[1:]:
        print(i//2)

main()
### BUGGY CODE ###

def larger(x, y):
	if x > y: return x
	else: return y

N, A = map(int, raw_input().split())
x = map(int, raw_input().split())
x.sort()
max = larger(x[-1], A)
dp = []

for i in range(0, N+1):
	tmp1 = []
	for j in range(0, N+1):
		tmp2 = []
		for k in range(0, N*max+1):
			tmp2.append(0)
		tmp1.append(tmp2)
	dp.append(tmp1)

for i in range(0, N+1):
	for j in range(0, N+1):
		for k in range(0, N*max+1):
			if i == 0:
				if j == 0 and k == 0: dp[i][j][k] = 1
			else:
				if k < x[i-1]: dp[i][j][k] = dp[i-1][j][k]
				elif j >= 1:
					dp[i][j][k] = dp[i-1][j][k] + dp[i-1][j-1][k-x[i-1]]

ans = 0
for i in range(1, N+1):
	ans = ans + dp[N][i][i*A]
print ans

### FIXED CODE ###

def larger(x, y):
	if x > y: return x
	else: return y

N, A = map(int, raw_input().split())
x = map(int, raw_input().split())
x = map(lambda a: a-A, x)
max = larger(x[-1], A)
dp = []

for i in range(0, N+1):
	tmp = []
	for j in range(0, 2*N*max+1):
		tmp.append(0)
	dp.append(tmp)

for i in range(0, N+1):
	for j in range(0, 2*N*max+1):
		if i == 0:
			if j == N*max: dp[i][j] = 1
		else:
			if j-x[i-1] < 0 or j-x[i-1] > 2*N*max:
				dp[i][j] = dp[i-1][j]
			else:
				dp[i][j] = dp[i-1][j] + dp[i-1][j-x[i-1]]

print dp[N][N*max]-1
### BUGGY CODE ###

c = 0
n = int(input())
for _ in range(n):
	t = int(input())
	for i in range(2,t):
		if t%i==0:
			break
	else:
		c+=1
print(c)

### FIXED CODE ###

import math
c = 0
n = int(input())
for _ in range(n):
	t = int(input())
	for i in range(2,int(math.sqrt(t)+1)):
		if t%i==0:
			break
	else:
		c+=1
print(c)
### BUGGY CODE ###

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

d = list(range(0))
for i in range(n):
    b = a[i][0] - a[i][1]
    c = a[i][0] + a[i][1]
    d.append([b,c])

def aaa():
  #print(d)
  e = list(range(0))
  mcnt = 0
  f = 0 
  for i in range(len(d)):
    cnt = 0
    #print(i)
    for j in range(len(d)):
      
      if i != j :      
        if (d[i][0] < d[j][0] and d[i][1] > d[j][0]) or (d[i][0] < d[j][1] and d[i][1] > d[j][1]):
          cnt = cnt + 1
          #print(cnt)
    if cnt > 0 and mcnt < cnt:
      mcnt = cnt
      f = i  
  #print(mcnt)
  if mcnt > 0 :
    d.pop(f)
    #print('pop')
  return mcnt
    
x = 1
while x > 0 :
  x = aaa()
  #print(x)


    
print(len(d)) 



 
    
  

         

  




### FIXED CODE ###

n = int(input())
robots = []
for i in range(n):
    x, l = [int(item) for item in input().split()]
    robots.append((x+l, x-l))
 
robots.sort()
#print(robots)

cnt = 0
node = -float("inf")
for end, start in robots:
    if start >= node:
        node = end
        cnt += 1
print(cnt)
### BUGGY CODE ###

sosu=[1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]
n=int(input())
ans=1
p=10**9+7
for i in sosu:
  if i<=n:
    stack=0
    num=i
    while num<=n:
      stack+=n//num
      num*=i
    ans*=(stack+1)
    ans%=p
print(ans)

### FIXED CODE ###

sosu=[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]
n=int(input())
ans=1
p=10**9+7
for i in sosu:
  if i<=n:
    stack=0
    num=i
    while num<=n:
      stack+=n//num
      num*=i
    ans*=(stack+1)
    ans%=p
print(ans)
### BUGGY CODE ###

import math
from fractions import gcd
from functools import reduce
def gcds(*numbers):
    return reduce(gcd, numbers)

def resolve():
    N = int(input())
    As = list(map(int, input().split(" ")))
    if N == 2:
        return max(As)

    gcdmax = 0
    for i in range(N):
        if i == N-1:
            g = gcds(*As[:i])
        else:
            g = gcds(*(As[:i]+As[i+1:]))
        gcdmax = max(gcdmax, g)

    return gcdmax

if '__main__' == __name__:
    print(resolve())

### FIXED CODE ###

import math
from fractions import gcd
from functools import reduce
def gcds(*numbers):
    return reduce(gcd, numbers)

def resolve():
    N = int(input())
    As = list(map(int, input().split(" ")))
    
    left = [0] * (N + 1)
    right = [0] * (N + 1)
    for i in range(N):
        left[i + 1] = (gcd(left[i],As[i]))
        right[N - 1 - i] = (gcd(right[(N - 1) - i + 1], As[(N - 1) - i]))

    gcdmax = 0
    for i in range(N):
        gcdmax = max(gcdmax, gcd(left[i], right[i+1]))
    return gcdmax

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

X,Y = map(int,input().split())
if X == Y:
  print(-1)
  exit()
for x in range(X,10**18+1,X):
  if x % Y != 0:
    print(x)
    exit()
print(-1)

### FIXED CODE ###

X,Y = map(int,input().split())
if  X == Y:
  print(-1)
  exit()
if X > Y and X % Y == 0:
  print(-1)
  exit()
for x in range(X,10**18+1,X):
  if x % Y != 0:
    print(x)
    exit()
### BUGGY CODE ###

x, y, z, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

a_plus_b = []
for i in a:
    for j in b:
        a_plus_b.append(i + j)
a_plus_b.sort(reverse=True)

a_plus_b_plus_c = []
for i in a_plus_b[:k]:
    for j in c:
        a_plus_b_plus_c.append(i + j)
a_plus_b_plus_c.sort(reverse=True)

for i in range(k):
    print(a_plus_b_plus_c[i])


### FIXED CODE ###

x, y, z, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

a_plus_b = []
for i in a:
    for j in b:
        a_plus_b.append(i + j)
a_plus_b.sort(reverse=True)

a_plus_b_plus_c = []
for i in a_plus_b[:k]:
    for j in c:
        a_plus_b_plus_c.append(i + j)
a_plus_b_plus_c.sort(reverse=True)

for i in range(k):
    print(a_plus_b_plus_c[i])