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

n = int(input())
inuput_list = [int(i) for i in input().split()]

result = []

for i in inuput_list:
    result.append(str(i))
    result = result[::-1]

print(" ".join(result))

### FIXED CODE ###

from collections import deque

n = int(input())

result = deque()
index = 0

if n % 2 == 0:
    for i in input().split():
        if index % 2 == 1:
            result.appendleft(i)
            index += 1
        else:
            result.append(i)
            index += 1
else:
    for i in input().split():
        if index % 2 == 1:
            result.append(i)
            index += 1
        else:
            result.appendleft(i)
            index += 1

print(" ".join(result))
### BUGGY CODE ###

N=int(input())
for h in range(1,3501):
  for n in range(1,3501):
    a=(4*h*n-N*(n+h))
    if a!=0:
      w=N*h*n/a
      if w==int(w) and 0<w<10000000:
        print(h,n,int(w),sep=" ")
        exit(0)

### FIXED CODE ###

N=int(input())
for h in range(int(N/4),3501):
  for n in range(h,3501):
    a=(4*h*n-N*(n+h))
    if a!=0:
      w=N*h*n/a
      if w==int(w) and 0<w<1000000000000:
        print(h,n,int(w),sep=" ")
        exit(0)
### BUGGY CODE ###

N=int(input())
ans=1
for i in range(N):
    ans=ans*(i+1)
print(ans%(10**9+7))


### FIXED CODE ###

N=int(input())
ans=1
for i in range(N):
    ans=ans*(i+1)%(10**9+7)
print(ans%(10**9+7))
### BUGGY CODE ###

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

cnt = 0
for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if s == x + y + z:
                cnt +=1
print(cnt)

### FIXED CODE ###

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

cont = 0
for x in range(k+1):
    for y in range(k+1):
        if x + y <= s:
            if s - (x+y) <= k:
                cont += 1
print(cont)
### BUGGY CODE ###

import sys; input = sys.stdin.buffer.readline
from collections import defaultdict
from fractions import gcd
con = 10 ** 9 + 7; INF = float("inf")

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

#処理内容
def main():
	N = int(input())
	AB = []
	D = defaultdict(int)
	DJ = defaultdict(int)
	d0x = 0; dx0 = 0; d00 = 0
	for i in range(N):
		A, B = getlist()
		if A == 0 and B == 0:
			d00 += 1
		elif A == 0:
			dx0 += 1
		elif B == 0:
			d0x += 1
		else:
			GCD = gcd(A, B)
			a = int(A // GCD)
			b = int(B // GCD)
			if a < 0:
				a = -a
				b = -b
			AB.append([a, b])
			D[(a, b)] += 1
			DJ[(a, b)] = 1

	ans = 1

	for a, b in AB:
		a2 = b; b2 = -a
		if a2 < 0:
			a2 = -a2; b2 = -b2
		if DJ[(a, b)] >= 0 and DJ[(a2, b2)] >= 0:
			DJ[(a, b)] = -1
			DJ[(a2, b2)] = -1
			X = D[(a, b)]
			Y = D[(a2, b2)]
			ans *= pow(2, X, con) + pow(2, Y, con) - 1
			ans %= con

	ans *= (pow(2, d0x, con) + pow(2, dx0, con)) - 1
	ans += d00
	ans %= con

	if ans == 0:
		print(10 ** 9  + 6)
	else:
		print(ans - 1)

if __name__ == '__main__':
	main()

### FIXED CODE ###

import sys; input = sys.stdin.buffer.readline
from collections import defaultdict
from fractions import gcd
con = 10 ** 9 + 7; INF = float("inf")

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

#処理内容
def main():
	N = int(input())
	AB = []
	D = defaultdict(int)
	DJ = defaultdict(int)
	d0x = 0
	dx0 = 0
	d00 = 0
	for i in range(N):
		A, B = getlist()
		if A == 0 and B == 0:
			d00 += 1
		elif A == 0:
			dx0 += 1
		elif B == 0:
			d0x += 1
		else:
			GCD = gcd(A, B)
			a = int(A // GCD)
			b = int(B // GCD)
			if a < 0:
				a = -a
				b = -b
			AB.append([a, b])
			D[a * (10 ** 19) + b] += 1
			DJ[a * (10 ** 19) + b] = 1

	ans = 1

	for a, b in AB:
		a2 = b; b2 = -a
		if a2 < 0:
			a2 = -a2; b2 = -b2
		if DJ[a * (10 ** 19) + b] >= 0 and DJ[a2 * (10 ** 19) + b2] >= 0:
			DJ[a * (10 ** 19) + b] = -1
			DJ[a2 * (10 ** 19) + b2] = -1
			X = D[a * (10 ** 19) + b]
			Y = D[a2 * (10 ** 19) + b2]
			ans *= pow(2, X, con) + pow(2, Y, con) - 1
			ans %= con

	ans *= (pow(2, d0x, con) + pow(2, dx0, con)) - 1
	ans += d00
	ans %= con

	if ans == 0:
		print(10 ** 9  + 6)
	else:
		print(ans - 1)

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

from fractions import gcd


def main():
    s_length, t_length = map(int, input().split())
    s = input()
    t = input()
    lcm = s_length * t_length // gcd(s_length, t_length)
    check = ["" for _ in range(lcm)]
    base = lcm // s_length
    for i in range(s_length):
        check[base * i] = s[i]
    base = lcm // t_length
    for i in range(t_length):
        if (0 < i and (check[base * i] != "" and check[base * i] != t[i])) or (i == 0 and t[0] != check[0]):
            print(-1)
            break
    else:
        print(lcm)


if __name__ == '__main__':
    main()




### FIXED CODE ###

from fractions import gcd


def main():
    s_length, t_length = map(int, input().split())
    s = input()
    t = input()
    lcm = s_length * t_length // gcd(s_length, t_length)
    answer = True
    for i in range(s_length):
        if (i * t_length) % s_length == 0 and s[i] != t[(i * t_length) // s_length]:
            answer = False
            break
    print(lcm if answer else -1)


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

def main():
    import sys
    input=sys.stdin.readline
    from collections import deque
    #class ctmp():
    #    def __init__(self,ij,dis):
    #        self.ij=ij
    #        self.dis=dis
    H,W=map(int,input().split())
    ls=["#"*(W+2)]
    for i in range(H):
        ls.append("#"+input()+"#")
    ls.append("#"*(W+2))
    q=deque([])
    qd=deque([])
    #tmp=ctmp((1,1),0)
    q.append((1,1))
    qd.append(0)
    df={}
    while q:
        tmpij=q.popleft()
        tmpd=qd.popleft()
        df[tmpij]=1
        if tmpij==(H,W):
            break
        for i in range(4):
            ntmpij=(tmpij[0]+(i<2)*(2*i-1),tmpij[1]+(i>1)*(2*i-5))
            #print(ntmpij)
            if ntmpij not in df and ls[ntmpij[0]][ntmpij[1]]==".":
                #c_tmp=ctmp(ntmpij,tmp.dis+1)
                #q.append(c_tmp)
                q.append(ntmpij)
                qd.append(tmpd+1)
    if tmpij==(H,W):
        nw=0
        for i in range(1,H+1):
            #for j in range(1,W+1):
             #   if ls[i][j]==".":
              #      nw+=1
            nw+=ls[i].count(".")
        print(nw-tmpd-1)
    else:
        print(-1)

if __name__=='__main__':
    main()


### FIXED CODE ###

def main():
    import sys
    input=sys.stdin.readline
    from collections import deque
    #class ctmp():
    #    def __init__(self,ij,dis):
    #        self.ij=ij
    #        self.dis=dis
    H,W=map(int,input().split())
    ls=["#"*(W+2)]#
    for i in range(H):
        ls.append("#"+input()+"#")
    ls.append("#"*(W+2))#
    q=deque([])
    #qd=deque([])
    #tmp=ctmp((1,1),0)
    q.append((1,1))
    #qd.append(0)
    #df={}
    lf=[[float("inf") for _ in range(W+2)] for _ in range(H+2)]#
    #これでfとdの両方の役割をこなす
    lf[1][1]=0
    while q:
        tmpij=q.popleft()
        #tmpd=qd.popleft()
        #df[tmpij]=1
        if tmpij==(H,W):
            break
        lind=[(-1,0),(1,0),(0,-1),(0,1)]#
        for i in range(4):
            #ntmpij=(tmpij[0]+(i<2)*(2*i-1),tmpij[1]+(i>1)*(2*i-5))
            ntmpij=(tmpij[0]+lind[i][0],tmpij[1]+lind[i][1])
            #print(ntmpij)
            #if ntmpij not in df and ls[ntmpij[0]][ntmpij[1]]==".":
            if lf[ntmpij[0]][ntmpij[1]]==float("inf") and ls[ntmpij[0]][ntmpij[1]]==".":
                #c_tmp=ctmp(ntmpij,tmp.dis+1)
                #q.append(c_tmp)
                q.append(ntmpij)
                #qd.append(tmpd+1)
                lf[ntmpij[0]][ntmpij[1]]=lf[tmpij[0]][tmpij[1]]+1
                #dは訪れる前に書き込んでしまう
    if tmpij==(H,W):
        nw=0
        for i in range(1,H+1):
            #for j in range(1,W+1):
             #   if ls[i][j]==".":
              #      nw+=1
            nw+=ls[i].count(".")
        #print(nw-tmpd-1)
        print(nw-lf[H][W]-1)
    else:
        print(-1)

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

def edu_dp_a_frog2():
    n, k = map(int, input().split())
    h = list(map(int, input().split()))
    dp = [float('inf')] * n
    dp[0] = 0
    dp[1] = abs(h[1]-h[0])
    for i in range(2, n):
        for j in range(1, min(i+1, k+1)):
            dp[i] = min(dp[i], dp[i-j]+abs(h[i]-h[i-j]))
    print(dp[n-1])

edu_dp_a_frog2()

### FIXED CODE ###

def edu_dp_a_frog2():
    n, k = map(int, input().split())
    h = list(map(int, input().split()))
    dp = [0] * n
    dp[0] = 0
    dp[1] = abs(h[1]-h[0])
    for i in range(2, n):
        dp[i] = min([dp[i-j]+abs(h[i]-h[i-j]) for j in range(1, min(i+1, k+1))])
        # for j in range(1, min(i+1, k+1)):
        #     dp[i] = min(dp[i], dp[i-j]+abs(h[i]-h[i-j]))
    print(dp[n-1])

edu_dp_a_frog2()
### BUGGY CODE ###

import sys
input = sys.stdin.readline

N = int(input())
P = [int(x) for x in input().split()]

count = 0
l = []
for x in P:
	l.append(x)
	if min(l) == x:
		count += 1

print(count)

### FIXED CODE ###

import sys
input = sys.stdin.readline

N = int(input())
P = [int(x) for x in input().split()]

l = []
for x in P:
	if not l or l[-1] > x:
		l.append(x)
	else:
		l.append(l[-1])

print(len(set(l)))
### BUGGY CODE ###

s=input()
q=int(input())

rev=1

for _ in range(0,q):
  n=input()
#  print(n[0:1])
  if n[0:1]=="1":
#    print("!")
    rev*=-1
  else:
    m=n.split()
    x=[]
    if (m[1]=="1" and rev==1) or (m[1]=="2" and rev==-1):
      x.append(m[2])
      x.append(s)
      s=''.join(x)
#      s=m[2]+s
    else:
      x.append(s)
      x.append(m[2])
      s=''.join(x)
#      s=s+m[2]
if rev==1:
  print(s)
else:
  print(s[::-1])


### FIXED CODE ###

s=input()
q=int(input())

rev=1

sf=""
sb=s

for _ in range(0,q):
  n=input().split()
  if n[0]=="1":
    rev*=-1
  else:
    if (n[1]=="1" and rev==1) or (n[1]=="2" and rev==-1):
      sf+=n[2]
    else:
      sb+=n[2]

s=sf[::-1]+sb

if rev==1:
  print(s)
else:
  print(s[::-1])
### BUGGY CODE ###

tmp = raw_input()
s = list(set(map(int, raw_input().split())))
tmp = raw_input()
t = sorted(map(int, raw_input().split()))

max_n = s[-1]
min_n = s[0]
ans = 0

for i in t:
	if i > max_n or i < min_n: continue
	for j in range(len(s)):
		if i == s[j]:
			s = s[s.index(j):]
			ans += 1
			break
		elif i <= s[j]:
			break
print ans

### FIXED CODE ###

input()
l = raw_input().split()
input()
print len(set(l) & set(raw_input().split()))
### BUGGY CODE ###

from copy import *
n = int(input())
a = [int(input()) for _ in range(n)]
tmp = deepcopy(a)
ans = 0
for _ in range(n):
    if set(a) == set([0]):
        break
    i = a.index(max(a))
    if i == 0:
        print(-1)
        exit()
    if a[i-1] + 1 == a[i]:
        a[i] = -1
        tmp[i] = 0
        ans += 1
    elif a[i-1] == -1:
        a[i-1] = a[i] - 1
        a[i] = -1
        tmp[i] = 0
        ans += 1
    else:
        print(-1)
        exit()
    if sum(tmp) == 0:
        break
print(ans)

### FIXED CODE ###

n = int(input())
prev = ans = -1
a = [int(input()) for _ in range(n)]
for i in a:
    if i - prev > 1:
        print(-1)
        exit()
    elif i - prev == 1:
        ans += 1
    else:
        ans += i
    prev = i
print(ans)
### BUGGY CODE ###

def s(a,d):
  n=len(a)
  if n==1:return a[0]*d
  return min(s(a[:i],d+1)+s(a[i:],d+1)for i in range(1,n))
n,*a=map(int,open(0).read().split())
print(s(a,0))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
def main():
  def s(l,r):
    k=l*n+r
    if d[k]:return d[k]
    if r-l<2:return 0
    d[k]=t=min(s(l,i)+s(i,r)for i in range(l+1,r))+a[r-1]-a[l-1]
    return t
  n,*a=map(int,open(0).read().split())
  d=[None]*(n*n+1)
  for i in range(n-1):a[i+1]+=a[i]
  a+=[0]
  print(s(0,n))
main()
### BUGGY CODE ###

n = int(input())
k = int(input())
s = 1
while n > 0:
  if s < k:
    s = s*2
  else:
    s += k
  n += 1
print(s)

### FIXED CODE ###

n = int(input())
k = int(input())
s = 1
while n > 0:
  if s < k:
    s = s*2
  else:
    s += k
  n -= 1
print(s)
### BUGGY CODE ###

n,p=map(int,input().split())
arr=[]
arr1=[[] for i in range(100001)]
for i in range(p):
    arr.append(list(map(int,input().split())))
    arr1[arr[i][0]].append(arr[i][1])
for i in range(100001):
    arr1[i].sort()
for i in range(p):
    print("%06d%06d"%(arr[i][0],arr1[arr[i][0]].index(arr[i][1])+1))

### FIXED CODE ###

import bisect
n,p=map(int,input().split())
arr=[]
arr1=[[] for i in range(100001)]
for i in range(p):
    arr.append(list(map(int,input().split())))
    arr1[arr[i][0]].append(arr[i][1])
for i in range(100001):
    if(len(arr1[i])>1):
        arr1[i].sort()
for i in range(p):
    print("%06d%06d"%(arr[i][0],bisect.bisect_right(arr1[arr[i][0]],arr[i][1])))
    #print("%06d%06d"%(arr[i][0],arr1[arr[i][0]].index(arr[i][1])+1))
### BUGGY CODE ###

#!/usr/bin/env python
# coding: utf-8

# In[2]:


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


# In[3]:


def main():
    x0 = 1
    for i in range(K):
        x0 *= A[i]
    x = x0
    for j in range(K,N):
        score = x*A[j]//A[j-K]
        if score > x:
            print("Yes")
        else:
            print("No")
        x = score


# In[4]:


if __name__ == '__main__':
    main()


# In[ ]:






### FIXED CODE ###

#!/usr/bin/env python
# coding: utf-8

# In[2]:


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


# In[9]:


def main():
    for j in range(K,N):
        if A[j] > A[j-K]:
            print("Yes")
        else:
            print("No")


# In[10]:


if __name__ == '__main__':
    main()


# In[ ]:
### BUGGY CODE ###

N,S=map(int,input().split())
A=list(map(int,input().split()))
dp=[[0 for i in range(S+1)]for j in range(N+1)]
dp[0][0]=1
for i in range(N):
    for j in range(S+1):
        if j-A[i]>=0:
            dp[i+1][j]+=dp[i][j-A[i]]+2*dp[i][j]
        else:
            dp[i+1][j]+=2*dp[i][j]
print(dp[N][S]%998244353)

### FIXED CODE ###

from copy import copy
import numpy as np
N,S=map(int,input().split())
A=list(map(int,input().split()))
dp=np.zeros(S+100,np.int64)
dp[0]=1
for i in range(N):
    buf=copy(dp)
    dp=2*dp
    dp[A[i]:]+=buf[:-A[i]]
    dp%=998244353
print(dp[S]%998244353)
### BUGGY CODE ###

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

ad=[1]*n
an=n

ad = [0 if a.count(a[i])>1 else 1 for i in range(n)]

for i in range(n-1):
    if ad[i]==1:
        for j in range(i+1,n):
            if a[j]%a[i]==0 and ad[j]==1:
                ad[j]=0
print(sum(ad))

### FIXED CODE ###

import numpy as np

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

amax=max(a)+1
ah=[0]*amax

for i in a:
    for j in range(i,amax,i):
        ah[j]+=1

an=0
for i in a:
    if ah[i]==1:
        an+=1
print(an)
### BUGGY CODE ###

from collections import defaultdict
import sys

S=sys.stdin.readline().strip()
l=len(S)

mod=10**9+7

dp=defaultdict(lambda: 0)   #dp[ (i,j) ]	i: nan-mojime,  j=0:All mojiretsu pattern , 1:A, 2:AB, 3:ABC
dp[(0,0)]=1

n=1
for i, s in enumerate(S):
	if s in "ABC":
		dp[ (i+1,0) ]=n
	elif s=="?":
		n*=3
		dp[ (i+1,0) ]=n		

nashi=0
a=1
ab=2
abc=3

for i,s in enumerate(S):
	if s =="A":
		dp[ (i+1,a) ]+=dp[ (i,nashi) ]
		dp[ (i+1,a) ]+=dp[ (i,a) ]
		dp[ (i+1,ab) ]+=dp[ (i,ab) ]
		dp[ (i+1,abc) ]+=dp[ (i,abc) ]
	elif s=="B":
		dp[ (i+1,ab) ]+=dp[ (i,ab) ]
		dp[ (i+1,ab) ]+=dp[ (i,a) ]
		dp[ (i+1,a) ]+=dp[ (i,a) ]
		dp[ (i+1,abc) ]+=dp[ (i,abc) ]
	elif s=="C":
		dp[ (i+1,abc) ]+=dp[ (i,abc) ]
		dp[ (i+1,abc) ]+=dp[ (i,ab) ]
		dp[ (i+1,a) ]+=dp[ (i,a) ]
		dp[ (i+1,ab) ]+=dp[ (i,ab) ]
	elif s=="?":
		dp[ (i+1,a) ]+=dp[ (i,a) ]*3
		dp[ (i+1,a) ]+=dp[ (i,nashi) ]
		dp[ (i+1,a) ]%=mod

		dp[ (i+1,ab) ]+=dp[ (i,ab) ]*3
		dp[ (i+1,ab) ]+=dp[ (i,a) ]	
		dp[ (i+1,ab) ]%=mod

		dp[ (i+1,abc) ]+=dp[ (i,abc) ]*3
		dp[ (i+1,abc) ]+=dp[ (i,ab) ]
		dp[ (i+1,abc) ]%=mod


print dp[(l,3)]%mod


### FIXED CODE ###

S=raw_input()

M=10**9+7

all=1
abc=0
ab=0
a=0

for x in S:
	if x=="A":
		a+=all
	if x=="B":
		ab+=a
	if x=="C":
		abc+=ab

	if x=="?":
		abc=abc*3+ab
		ab=ab*3+a
		a= a*3+all
		all*=3

	abc%=M
	ab%=M
	a%=M
	all%=M


print abc%M
### BUGGY CODE ###

import numpy
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
A_front = A[0:K]
A_end = A[K::]
tmp_m = 1
for a in A:
    tmp_m = tmp_m * a
for i, a in enumerate(A_end):
    tmp_m_old = tmp_m
    tmp_m = (tmp_m // A[i]) * a
    if tmp_m_old < tmp_m:
        print('Yes')
    else:
        print('No')

### FIXED CODE ###

N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
for i in range(K, N):
    if A[i] > A[i - K]:
        print('Yes')
    else:
        print('No')
### BUGGY CODE ###

from collections import Counter

mod = 1000000007


def inverse(a):
    return pow(a, mod - 2, mod)


def usearch(x, a):
    lft = 0
    rgt = len(a) + 1
    while rgt - lft > 1:
        mid = (rgt + lft) // 2
        if a[mid] <= x:
            lft = mid
        else:
            rgt = mid
    return lft

memo = [
    [0, 1, 1],
    [1,10,9],
    [2,11,9],
    [3,4,3],
    [4,13,9],
    [5,14,9],
    [6,5,3],
    [7,16,9],
    [8,17,9],
    [9,2,1],
]


def main():
    m = int(input())
    dc = [[int(i) for i in input().split()] for _ in range(m)]
    s = []
    ans = 0
    for i in range(m):
        d = dc[i][0]
        c = dc[i][1]
        ans += c // memo[d][2] * memo[d][1]
        if d == 9:
            ans -= 2
            s.append([d, 1])
        else:
            s.append([d, (c % memo[d][2])])
    if not s:
        print(ans)
        return

    t = s[0][0]
    s[0][1] -= 1
    for i in range(len(s)):
        if s[i][0] == 1:
            ans += s[i][1]
            t += s[i][1]
            if t > 9:
                ans += 1
                t = t % 10 + t // 10
            continue
        while s[i][1]:
            s[i][1] -= 1
            ans += 1
            t += s[i][0]
            if t > 9:
                ans += 1
                t = t % 10 + t // 10

    print(ans)

main()


### FIXED CODE ###

from collections import Counter

mod = 1000000007


def inverse(a):
    return pow(a, mod - 2, mod)


def usearch(x, a):
    lft = 0
    rgt = len(a) + 1
    while rgt - lft > 1:
        mid = (rgt + lft) // 2
        if a[mid] <= x:
            lft = mid
        else:
            rgt = mid
    return lft

def main():
    m = int(input())
    ans = 0
    a = 0
    for i in range(m):
        d, c = map(int, input().split())
        ans += c
        a += d * c
    print(ans + (a - 1) // 9 - 1)

main()
### BUGGY CODE ###

N = int(input())

A_i = []
for i in range(N):
    A_i.append(int(input()))

for i in range(N):
    A_i_copy = A_i[:]
    A_i_copy.pop(i)
    print(max(A_i_copy))

### FIXED CODE ###

N = int(input())

A_i = []
for i in range(N):
    A_i.append(int(input()))

A_i_sord = sorted(A_i)
A_i_max_first = A_i_sord[N - 1]
A_i_max_second = A_i_sord[N - 2]

for i in range(N):
    if A_i_max_first == A_i[i]:
        print(A_i_max_second)
    else:
        print(A_i_max_first)
### BUGGY CODE ###

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

for i in X:
  x = sorted(X)
  p = x.index(i)
  x.pop(p)
  print(x[n//2- 1])

### FIXED CODE ###

n = int(input())
X = list(map(int, input().split()))
x = sorted(X)

res1 = x[n//2]
res2 = x[n//2 -1]

for i in range(n):
  if X[i] >= res1:
    print(res2)
  elif X[i] <= res2:
    print(res1)
### BUGGY CODE ###

N,M=map(int,input().split())
L,R=map(int,input().split())
ans=list(range(L,R+1))
for i in range(M-1):
    H,I=map(int,input().split())
    ans=list(filter(lambda key:H<=key<=I,ans))
    if ans==[]:
        break
print(len(ans))

### FIXED CODE ###

N,M=map(int,input().split())
L,R=map(int,input().split())
for i in range(M-1):
    H,I=map(int,input().split())
    if H>L:
        L=H
    if R>I:
        R=I
    if R<L:
        break
if R<L:
    print(0)
else:
    ans=list(range(L,R+1))
    print(len(ans))
### BUGGY CODE ###


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

mod=10**9+7

ans=0
for i in range(N-1):
    for j in range(i+1,N):
        ans+=(A[i]*A[j])%mod
print(ans%mod)
        

### FIXED CODE ###


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

mod=10**9+7

sumA=sum(A)

ans=0
for i in range(N):
    ans+=(A[i]*(sumA-A[i]))

ans=ans//2
print(ans%mod)
### BUGGY CODE ###

A, B, K = map(int,input().split())
li = [i for i in range(A,B + 1)]
ans = set(li[:K] + sorted(li,reverse = True)[:K])
  
for i in sorted(ans):
  print(i)

### FIXED CODE ###

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

ans = []
for i in range(K):
  if A + i <= B:
    ans.append(A + i)
  if B - i >= A:
    ans.append(B - i)

for i in sorted(set(ans)):
  print(i)
### BUGGY CODE ###

def main():
    n, k, c = map(int, input().split())
    s = input()

    go = set()
    back = set()

    i = 0
    while i < n:
        if s[i] == 'o':
            go.add(i)
            if len(go) == k:
                break
            i += c + 1
        else:
            i += 1

    if len(go) < k:
        return

    i = n - 1
    while i >= 0:
        if s[i] == 'o':
            back.add(i)
            if len(back) == k:
                break
            i -= c + 1
        else:
            i -= 1

    if len(back) < k:
        return

    isec = go & back

    ret = []
    for elm in isec:
        go = set()
        i = 0
        while i < n:
            if i == elm:
                i += 1
                continue

            if s[i] == 'o':
                go.add(i)
                if len(go) == k:
                    break
                i += c + 1
            else:
                i += 1

        if len(go) < k:
            ret.append(elm)

    print(*map(lambda x: x + 1, ret), sep='\n')


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    N, K, C = map(int, input().split())
    s = input()

    L = [-1] * K
    R = [-1] * K

    i = 0
    cur = 0
    while i < N and cur < K:
        if s[i] == 'o':
            L[cur] = i
            cur += 1
            i += C + 1
        else:
            i += 1

    i = N - 1
    cur = K - 1
    while i >= 0 and cur >= 0:
        if s[i] == 'o':
            R[cur] = i
            cur -= 1
            i -= C + 1
        else:
            i -= 1

    ans = (left + 1 for left, right in zip(L, R) if left == right)

    print(*ans, sep='\n')


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

n,s=map(int,input().split())
A=list(map(int,input().split()))
mod=998244353
ans=0
dp=[[0 for _ in range(s+1)] for _ in range(n+1)]
dp[0][0]=1

for i in range(n):
    for c in range(s+1):
        if c>=A[i]:
            dp[i+1][c]=(2*dp[i][c]+dp[i][c-A[i]])%mod
        else:
            dp[i+1][c]=(2*dp[i][c])%mod

print(dp[n][s]%mod)


### FIXED CODE ###

n,s=map(int,input().split())
A=list(map(int,input().split()))
mod=998244353
ans=0
dp=[[0 for _ in range(s+1)] for _ in range(n+1)]
dp[0][0]=1

for i in range(n):
    for c in range(s+1):
        if c>=A[i]:
            dp[i+1][c]=(2*dp[i][c]+dp[i][c-A[i]])%mod
        else:
            dp[i+1][c]=(2*dp[i][c])%mod

print(dp[n][s]%mod)
### BUGGY CODE ###

import fractions as math
from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

N=int(input())
A=list(map(int,input().split()))
MOD=(10**9)+7
S=list(set(A))
LCM=lcm_list(S)
ans=0

for i in range(N):
    ans+=(LCM//A[i])
    ans=ans%MOD

print(ans)

### FIXED CODE ###

import fractions
from functools import reduce

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

N=int(input())
A=list(map(int,input().split()))
MOD=(10**9)+7
S=list(set(A))
LCM=lcm_list(S)
ans=0

for i in range(N):
    ans+=(LCM//A[i])


print(ans%MOD)
### BUGGY CODE ###

import math

x = int(input())
 
ans = x
 
while True:
  for i in range(2, int(math.sqrt(ans))):
    if ans % i == 0:
      continue
  else:
    print(ans)
  ans += 1

### FIXED CODE ###

import math

x = int(input())
 
ans = x
 
while True:
  for i in range(2, int(math.sqrt(ans))):
    if ans % i == 0:
      break
  else:
    print(ans)
    exit()
  ans += 1