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

# coding: utf-8
# Your code here!

ans = 10**9


def calc(point,num, i):
    global ans
    global G, D
    if num > ans:
        return
    if point >= G:
        if num < ans:
            ans = num
        return
    if i >= D:
        return
    for j in range(problem[i][0]):
        tmp = point
        for k in range(i, D):
            tmp += (k+1)*100*problem[k][0]+problem[k][1]
        if tmp < G:
            return
        calc(point + (i+1) * 100 * j,num+j, i+1)
    calc(point + (i+1) * 100 * problem[i][0] + problem[i][1],num+problem[i][0], i+1)

D, G=map(int, input().split()) 
problem=[list(map(int,list(input().split()))) for i in range(D)]

calc(0,0,0)

print(ans)



### FIXED CODE ###

# coding: utf-8
# Your code here!
from itertools import product

ans = 10**9

D, G=map(int, input().split()) 
problem=[list(map(int,list(input().split()))) for i in range(D)]

for p in product([True, False], repeat=D):
    
    point = 0
    num = 0
    
    for i in range(D):
        if p[i]:
            point += (i+1) * 100 * problem[i][0] + problem[i][1]
            num += problem[i][0]
            
    if point >= G:
        ans = min(ans, num)
    
    for i in reversed(range(D)):
        if p[i] == False:
            if point >= G:
                ans = min(ans, num)
                break
            for j in range(problem[i][0]):
                point += (i+1) * 100
                num += 1
                if point >= G:
                    break
    if point >= G:
        ans = min(ans, num)
print(ans)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
 
## Library
 
import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools
import copy
 
## input
 
# N=int(input())
# A,B,C,D=map(int, input().split())
# S = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]
#    S = []
#    for _ in range(N):
#        S.append(list(input()))
 
N,K=map(int, input().split())
P = list(map(int, input().split()))

S = []

for i in range(K):
    S.append((P[i]+1)/2)

ans = sum(S)

for i in range(K,N):
    S.append((P[i]+1)/2)
    ans = max(ans, sum(S[i-K+1:]))


print(ans)


### FIXED CODE ###

# -*- coding: utf-8 -*-
 
## Library
 
import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools
import copy
 
## input
 
# N=int(input())
# A,B,C,D=map(int, input().split())
# S = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]
#    S = []
#    for _ in range(N):
#        S.append(list(input()))
 
N,K=map(int, input().split())
P = list(map(int, input().split()))

S = []

for i in range(N):
    S.append((P[i]+1)/2)

tmp = sum(S[:K])
ans = tmp

for i in range(N-K):
    tmp = tmp - S[i] + S[i+K]
    ans = max(ans, tmp)


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

from collections import Counter
n = int(input())
a = list(map(int, input().split()))
a_cnt = Counter(a)

a = sorted(list(set(a)))
n = len(a)
def divisor(n):
    res = []
    for i in range(1, int(n ** 0.5)+1):
        if n % i == 0:
            res.append(i)

            if i != n // i and i != 1:
                res.append(n // i)
    return res

divs = [set(divisor(a[i])) for i in range(n)]

ans = 0
memo = set()
for i in range(n):
    if a_cnt[a[i]] == 1:
        if memo & divs[i] == set():
            ans += 1

    memo.add(a[i])

print(ans)


### FIXED CODE ###

import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
a.sort()

flg = [True for _ in range(10 ** 6 + 1)]
for i in range(n-1):
    if a[i] == a[i+1]:
        flg[a[i]] = False

ans = 0
for x in set(a):
    if flg[x]:
        ans += 1

    tmp = 1
    while tmp * x <= 10 ** 6:
        flg[tmp * x] = False
        tmp += 1

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

n=int(input())
S=[0 if i=='.' else 1 for i in input()]
if sum(S)==0 or sum(S)==n:
    print(0)
    exit()
allblack=n-sum(S)
allwhite=sum(S)
bw=10**6
from itertools import accumulate
accS=list(accumulate(S))
for i in range(n):
    bw=min(bw,accS[i]+(n-(i+1))-(sum(S)-accS[i]))
print(min(bw,allblack,allwhite))

### FIXED CODE ###

n=int(input())
S=[0 if i=='.' else 1 for i in input()]
if sum(S)==0 or sum(S)==n:
    print(0)
    exit()
sS=sum(S)
allblack=n-sum(S)
allwhite=sum(S)
bw=10**6
from itertools import accumulate
accS=list(accumulate(S))
for i in range(n):
    bw=min(bw,accS[i]+(n-(i+1))-(sS-accS[i]))
print(min(bw,allblack,allwhite))
### BUGGY CODE ###

from collections import deque
H, W = map(int, input().split())
cy, cx = map(int, input().split())
dy, dx = map(int, input().split())
cy -= 1
cx -= 1
dy -= 1
dx -= 1

S = [input() for _ in range(H)]

worps = [[float('inf')]*W for _ in range(H)]
used = [[False]*W for _ in range(H)]
q = deque([[cy, cx]])

worp = 0
while q:
    v = {}
    while q:
        y, x = q.popleft()
        used[y][x] = True
        worps[y][x] = min(worps[y][x], worp)

        for h in range(-2+y, 3+y):
            for w in range(-2+x, 3+x):
                if 0 <= h and h < H and 0 <= w and w < W and S[h][w] == ".":
                    v[(h, w)] = True

        for h, w in [[0, 1], [0, -1], [1, 0], [-1, 0]]:
            ny, nx = y+h, x+w
            if 0 <= ny and ny < H and 0 <= nx and nx < W:
                if not used[ny][nx] and S[ny][nx] == ".":
                    q.append([ny, nx])

    worp += 1
    for h, w in v.keys():
        if not used[h][w]:
            q.append([h, w])
            used[h][w] = True

ans = worps[dy][dx]
if ans != float('inf'):
    print(ans)
else:
    print(-1)


### FIXED CODE ###

from collections import deque
H, W = map(int, input().split())
cy, cx = map(int, input().split())
dy, dx = map(int, input().split())
cy -= 1
cx -= 1
dy -= 1
dx -= 1
d = [[0, 1], [0, -1], [1, 0], [-1, 0]]
S = [input() for _ in range(H)]

worps = [[float('inf')]*W for _ in range(H)]
q = deque([[cy, cx]])

worps[cy][cx] = 0
while q:
    y, x = q.popleft()
    worp = worps[y][x]

    for h, w in d:
        ny, nx = y+h, x+w
        if 0 <= ny < H and 0 <= nx < W and S[ny][nx] == "." and worp < worps[ny][nx]:
            worps[ny][nx] = worp
            q.appendleft([ny, nx])

    worp += 1
    for h in range(-2+y, 3+y):
        for w in range(-2+x, 3+x):
            if 0 <= h < H and 0 <= w < W and S[h][w] == "." and worp < worps[h][w]:
                worps[h][w] = worp
                q.append([h, w])

ans = worps[dy][dx]
if ans != float('inf'):
    print(ans)
else:
    print(-1)
### BUGGY CODE ###

K,S = map(int,input().split())
counter = 0
for x in range(K+1):
  for y in range(K+1):
    for z in range(K+1):
      if x+y+z == S:
        counter += 1
print(counter)

### FIXED CODE ###

K,S = map(int,input().split())
counter = 0
for x in range(K+1):
  for y in range(K+1):
    if 0 <= S - (x + y) <= K:
      counter += 1

print(counter)
### BUGGY CODE ###

from itertools import product as p
n=int(input())
s=[[]for i in range(n+1)]
for i in range(n-1):
    a,b=map(int,input().split())
    s[a].append([b,i])
    s[b].append([a,i])
m=int(input())
l=[]
for i in range(m):
    u,v=map(int,input().split())
    a=[[]for i in range(n+1)]
    a[u]=[]
    q=[u]
    while q:
        t=q.pop(0)
        d=0
        for i,j in s[t]:
            if a[i]==[]:
                a[i]=a[t]+[j]
                q.append(i)
                if i==v:
                    d=1
                    break
        if d==1:
            break
    l.append(a[v])
for i in range(m):l[i]=set(l[i])
s=[0]*(m+1)
for i in p([0,1],repeat=m):
    d=set([])
    if sum(i)!=0:
        for j in range(m):
            if i[j]:
                d|=l[j]
        s[sum(i)]+=pow(2,n-1-len(d))
l=0
for i in range(1,m+1):
    l+=((-1)**(i-1))*s[i]
print(pow(2,n-1)-l)

### FIXED CODE ###

from itertools import product as p
n=int(input())
s=[[]for i in range(n+1)]
for i in range(n-1):
    a,b=map(int,input().split())
    s[a].append([b,i])
    s[b].append([a,i])
m=int(input())
l=[]
for i in range(m):
    u,v=map(int,input().split())
    a=[[]for i in range(n+1)]
    a[u]=[]
    q=[u]
    while q:
        t=q.pop(0)
        d=0
        for i,j in s[t]:
            if a[i]==[]:
                a[i]=a[t]+[j]
                q.append(i)
                if i==v:
                    d=1
                    break
        if d==1:
            break
    l.append(a[v])
for i in range(m):l[i]=set(l[i])
s=[0]*(m+1)
for i in p([0,1],repeat=m):
    d=set([])
    if sum(i)!=0:
        for j in range(m):
            if i[j]:
                d|=l[j]
        s[sum(i)]+=pow(2,n-1-len(d))
l=0
for i in range(1,m+1):
    l+=((-1)**(i-1))*s[i]
print(pow(2,n-1)-l)
### BUGGY CODE ###

N,M = map(int,input().split())
A = [list(input().split())for i in range(M)]
ans = 0
pen = 0
r = []
for i in range(len(A)):
  if A[i][1] == 'AC':
    r.append(A[i][0])
R = list(set(r))
ans = len(R)
for _ in range(ans):
  for j in range(len(A)):
    if A[j][0] == R[0] and A[j][1] == 'AC':
      del R[0]
      break
    if A[j][0] == R[0] and A[j][1] == 'WA':
      pen+=1
print(ans,pen)


### FIXED CODE ###

N,M = map(int,input().split())
ans = [0]*N
pen = [0]*N
for _ in range(M):
  p,S = input().split()
  P = int(p)
  if ans[P-1] == 1:
    continue
  elif ans[P-1] == 0:
    if S == 'AC':
      ans[P-1] += 1
    elif S == 'WA':
      pen[P-1] += 1
      
A = 0
B = 0 
for i in range(N):
  if ans[i] == 1:
    A += 1
    B += pen[i]
print(A,B)
### BUGGY CODE ###

import collections
import math
def P(n,r):
    return math.factorial(n) // math.factorial(n-r)
def C(n,r):
    return P(n,r) // math.factorial(r)
n = int(input())
a = list(map(str,input().split()))
ans = []
cnt = 0
for i in range(n):
    tmp = a[:i] + a[i+1:]
    set_tmp = set(tmp)
    c = collections.Counter(tmp)
    cnt = 0
    for j in set_tmp:
        if int(c[j]) < 2:
            cnt += 0
        else:
            cnt += C(int(c[j]),2)
    ans.append(cnt)
    cnt = 0
for i in ans:
    print(i)


### FIXED CODE ###

import collections
import math
def P(n,r):
    return math.factorial(n) // math.factorial(n-r)
def C(n,r):
    return P(n,r) // math.factorial(r)
n = int(input())
a = list(map(str,input().split()))
c = collections.Counter(a)
s = 0
for i in list(c.values()):
    s += i*(i-1)//2
for i in a:
    ans = s - (int(c[str(i)] - 1))
    print(ans)
### BUGGY CODE ###

a, b, c, k = map(int, input().split())

x = 0
yy = 0

while x != k:
    if a >= 1:
        yy += 1
        a -= 1
        x += 1
       
    elif b >= 1:
        b -= 1
        x += 1
      
    elif c >= 1:
        yy -= 1
        c -= 1
        x += 1
print(yy)

### FIXED CODE ###


a, b, c, k = map(int, input().split())



if k <= a:      #aのほうがｋ（カードを引く回数より）大きかった時
    ans = k     #ｋの回数分＝最大値
else:           #aよりｋのほうが大きかった時
    y = k - a   #引く回数 - a = 残りの引ける数
    if y <= b:  #ｂより残り引ける数が小さければ
        ans = a
    else :
        y -= b
        ans = a - y
print(ans)
### BUGGY CODE ###

#import sys
#input = sys.stdin.readline
n=int(input())
a=[int(i) for i in input().split()]

#print(a)
ans=0
if n==1:
  ans=1
else:
  for i in range(1,100000+1):
    cnt=0
    maxa=max(a)
    for j in range(len(a)):
      if a[j]==i or a[j]==i-1 or a[j]==i+1:
        cnt+=1
      if ans <= cnt:
        ans = cnt

print(ans)



### FIXED CODE ###

from collections import Counter

#tmp_list = [1, 1, 1, 1, 0, 1, 1]


n=int(input())
a=[int(i) for i in input().split()]
b=[i-1 for i in a]
c=[i+1 for i in a]
d=a+b+c

counter = Counter(d)

print(counter.most_common()[0][1])
### BUGGY CODE ###

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

count = 0
top = bottom = ""

for i in range(q):
  query = list(input().split())
  if query[0] == "1":
    count = (count + 1) % 2  
  if query[0] == "2":    
    if query[1] == "1":      
      if count == 0:        
        top += query[2]       
      else:
        bottom += query[2]
    if query[1] == "2":      
      if count == 0:        
        bottom += query[2]        
      else:       
        top += query[2]
  
s = top[::-1] + s + bottom

if count == 1:  
  s = s[::-1]
  
print(s)

### FIXED CODE ###

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

count = 0
top = []
bottom = []

for i in range(q):
  query = list(input().split())
  if query[0] == "1":
    count = (count + 1) % 2  
  if query[0] == "2":    
    if query[1] == "1":      
      if count == 0:        
        top.append(query[2])    
      else:
        bottom.append(query[2])
    if query[1] == "2":      
      if count == 0:        
        bottom.append(query[2])        
      else:       
        top.append(query[2])
  
t = "".join(top)
b = "".join(bottom)

lst = [t[::-1], s, b]
ans = "".join(lst)

if count == 1:
  ans = ans[::-1]
  
print(ans)
### BUGGY CODE ###

n,k=map(int,input().split())
mod=998244353
S=set()
for _ in range(k):
  l,r=map(int,input().split())
  S|={i for i in range(l,r+1)}
dp=[0 for _ in range(n+1)]
for i in S:
  dp[i]=1

for i in range(1,n+1):
  for j in S:
    if i-j<1:
        continue
    dp[i]+=dp[i-j]
print(dp[n-1]%mod)

### FIXED CODE ###

n,k=map(int,input().split())
mod=998244353
R=[]
for _ in range(k):
  l,r=map(int,input().split())
  R.append([l,r])

dp=[0 for _ in range(n+1)]
dp[1]=1
dpsum=[0 for _ in range(n+1)]
dpsum[1]=1
for i in range(2,n+1):
  for j in range(k):
    li=i-R[j][1]
    ri=i-R[j][0]
    if ri<0:
      continue
    li=max(li,1)
    dp[i]+=(dpsum[ri]-dpsum[li-1])%mod
  dpsum[i]=dpsum[i-1]+dp[i]
  dpsum[i]%=mod
print(dp[n]%mod)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
b = [-1] * m
c = [-1] * m
for j in range(m):
    a.sort()
    b[j], c[j] = map(int, input().split())
    count = 0
    for i in range(len(a)):
        if count >= b[j]:
            break
        if a[i] > c[j]:
            break
        if a[i] < c[j]:
            a[i] = c[j]
            count += 1

print(sum(a))

### FIXED CODE ###

# -*- coding: utf-8 -*-
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
bc = [tuple(map(int, input().split())) for _ in range(m)]
bc.sort(key=lambda t: t[1], reverse=True)

index = 0
count = [0] * m
for i in range(n):
    if index >= m or a[i] >= bc[index][1]:
        break
    a[i] = bc[index][1]
    count[index] += 1
    if count[index] >= bc[index][0]:
        index += 1

print(sum(a))
### BUGGY CODE ###

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

cnt, prev_cnt = 0, -1
while cnt != prev_cnt:
    prev_cnt = cnt
    for i in range(n):
        
        adj_sum = b[i - 1] + b[(i + 1) % n]
        k = (b[i] - a[i]) // adj_sum
        if k > 0:
            b[i] -= k * adj_sum
            cnt += k


print(cnt if a == b else -1)

### FIXED CODE ###

#import sys
#input = sys.stdin.readline

n = int(input())
a = [0]*n
b = [0]*n
a =[int(xi) for xi in input().split()]
b =[int(yi) for yi in input().split()]

cnt, prev_cnt = 0, -1
while cnt != prev_cnt:
    prev_cnt = cnt
    for i in range(n):
        
        adj_sum = b[i - 1] + b[(i + 1) % n]
        k = (b[i] - a[i]) // adj_sum
        if k > 0:
            b[i] -= k * adj_sum
            cnt += k

print(cnt if a == b else -1)
### BUGGY CODE ###

S=input()
q=int(input())
rev=False
pre=''
for i in range(q):
    inp=input()
    if inp[0]=="1":
        rev=not rev
    else:
        t,f,c=inp.split()
        if (f=='1' and rev) or (f=='2' and not rev):
            S+=c
        else:
            pre+=c
if not rev:
    print(pre[::-1]+S)
else:
    print(S[::-1]+pre)

### FIXED CODE ###

S=input()
q=int(input())
RV=0
A="A"
for i in range(q):
    IN=input()
    if IN=="1":
        RV+=1
    else:
        t,f,c=IN.split()
        if RV%2==0:
            if f=="1":
                A=c+A               
            else:
                A=A+c
        else:
            if f=="1":
                A=A+c
            else:
                A=c+A
if RV%2==0:
    for i in range(len(A)):
        if A[i]=="A":
            print(A[:i]+S+A[i+1:])
else:
    A=A[::-1]
    for i in range(len(A)):
        if A[i]=="A":
            print(A[:i]+S[::-1]+A[i+1:])
### BUGGY CODE ###

n, q = map(int, input().split())
s = [x for x in list(map(str, input()))]
lr = []
for i in range(q):
    lr.append(list(map(int, input().split())))

result = []
for i in range(q):
    left = lr[i][0] - 1
    right = lr[i][1] - 1
    substring = s[left:right + 1]
    ans = 0
    for j in range(1, len(substring)):
        if substring[j - 1] == 'A' and substring[j] == 'C':
            ans += 1
    result.append(ans)

for i in range(len(result)):
    print(result[i])


### FIXED CODE ###

def main():
    N, Q = map(int, input().split())
    S = input()

    list = [0] * (N + 1)

    for i in range(N):
        list[i + 1] = list[i] + (1 if S[i:i + 2] == "AC" else 0)

    for i in range(Q):
        a, b = map(int, input().split())
        output = list[b - 1] - list[a - 1]
        print(output)


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

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

if N % 2 == 0:
    for i in range(1, N, 2):
        if A.count(i) == 2:
            pass
        else:
            print(0)
            exit()
    ans = (2 ** (N // 2))%mod

else:
    for i in range(0, N, 2):
        if i == 0:
            if A.count(i) == 1:
                pass
            else:
                print(0)
                exit()
        else:
            if A.count(i) == 2:
                pass
            else:
                print(0)
                exit()
        ans = (2 ** (N // 2)) % mod

print(ans)

### FIXED CODE ###

import collections
mod = 10 ** 9 + 7
N = int(input())
A = list(map(int, input().split()))
a = collections.Counter(A)
a = a.most_common()[::-1]

if N % 2 == 0:
    for i in range(len(a)):
        if a[i][0] % 2 == 1 and a[i][1] == 2:
            pass
        else:
            print(0)
            exit()
    ans = (2 ** (N // 2)) % mod

else:
    for i in range(len(a)):
        if a[i][0] == 0:
            if a[i][1] == 1:
                pass
            else:
                print(0)
                exit()
        else:
            if a[i][0] % 2 == 0 and a[i][1] == 2:
                pass
            else:
                print(0)
                exit()
    ans = (2 ** (N // 2)) % mod 
print(ans)
### BUGGY CODE ###

from operator import mul
from functools import reduce
n = int(input())
list_A = list(map(int, input().split()))

def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

for i in range(n):
    a = list_A.pop(i)
    b = list(set(list_A))
    ans = 0
    for j in range(len(b)):
        c = list_A.count(b[j])
        if c != 1:
            ans += cmb(c,2)
    print(ans)
    list_A.insert(i,a)

### FIXED CODE ###

n = int(input())
list_A = list(map(int, input().split()))
list_B = list(set(list_A))
list_M = [0 for _ in range(n+1)]

for s in list_A:
    list_M[s] += 1
total = 0

for i in range(n+1):
    total += list_M[i]*(list_M[i]-1)//2

for s in list_A:
    ans = total - list_M[s] + 1
    print(ans)
### BUGGY CODE ###

n,q = map(int,input().split())
s = input()
ac = [0 for i in range(n+1)]
ans = []
for i in range(len(s)-1):
    if s[i]=="A":
        if s[i+1]=="C":
            ac[i+1] = 1

for i in range(q):
    l,r = map(int,input().split())
    ans.append(sum(ac[l:r]))
#ここから出力
for i in ans:
    print(i)

### FIXED CODE ###

n,q = map(int,input().split())
s = input()
ac = [0 for i in range(n+1)]
ans = []
for i in range(len(s)-1):
    if s[i:i+2]=="AC":
        ac[i+1] = ac[i] + 1
    else:
        ac[i+1] = ac[i]

for i in range(q):
    l,r = map(int,input().split())
    print(ac[r-1]-ac[l-1])
### BUGGY CODE ###

class Group:
    
    def __init__(self, a, b):
        self.member = {a, b}
        self.n = 2
        
        
N, M = list(map(int, input().split()))
AB = [list(map(int, input().split())) for _ in range(M)]

d = {}
ans = [None] * M
ans[-1] = (N - 1) * N // 2
pre = ans[-1]
count = -2
for a, b in AB[:0:-1]:
    now = pre
    if a in d:
        if b in d:
            group1, group2 = d[a], d[b]
            if group1 is group2:
                pass
            else:
                now -= group1.n * group2.n
                group1.member |= group2.member
                group1.n += group2.n
                for x in group2.member:
                    d[x] = group1
        else:
            group = d[a]
            now -= group.n
            group.member.add(b)
            group.n += 1
            d[b] = group
    elif b in d:
        group = d[b]
        now -= group.n
        group.member.add(a)
        group.n += 1
        d[a] = group
    else:
        group = Group(a, b)
        d[a] = group
        d[b] = group
        now -= 1
    ans[count] = now
    pre = now
    count -= 1
print("\n".join(map(str, ans)))

### FIXED CODE ###

class Group:
    
    def __init__(self, a, b):
        self.member = {a, b}
        self.n = 2
        
        
N, M = list(map(int, input().split()))
AB = [list(map(int, input().split())) for _ in range(M)]

d = {}
ans = [None] * M
ans[-1] = (N - 1) * N // 2
pre = ans[-1]
count = -2
for a, b in AB[:0:-1]:
    now = pre
    if a in d:
        if b in d:
            group1, group2 = d[a], d[b]
            if group1 is group2:
                pass
            else:
                if group1.n < group2.n:
                    group1, group2 = group2, group1
                now -= group1.n * group2.n
                group1.member |= group2.member
                group1.n += group2.n
                for x in group2.member:
                    d[x] = group1
        else:
            group = d[a]
            now -= group.n
            group.member.add(b)
            group.n += 1
            d[b] = group
    elif b in d:
        group = d[b]
        now -= group.n
        group.member.add(a)
        group.n += 1
        d[a] = group
    else:
        group = Group(a, b)
        d[a] = group
        d[b] = group
        now -= 1
    ans[count] = now
    pre = now
    count -= 1
print("\n".join(map(str, ans)))
### BUGGY CODE ###

a,b,k=map(int,input().split())

for i in range(a,b+1):
  if i <= (a+k-1) or i >= (b-k+1):
    print(i)

### FIXED CODE ###

a,b,k=map(int,input().split())

ans=[]

for i in range(a,a+k):
  if i<=b:
    ans.append(i)
  
for i in range(b-k+1,b+1):
  if i>=a and i not in ans:
    ans.append(i)
    
ans.sort()

for a in ans:
  print(a)
### BUGGY CODE ###

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

ans = 1
for i in range(N):
  ans *= A[i]

if ans>10**18:
  print(-1)
else:
  print(ans)

### FIXED CODE ###

import sys
N = int(input())
x = list(map(int,input().split()))
 
z = 1
if 0 in x:
  print(0)
  sys.exit()
  
for a in x:
  z = a*z
  if z > 10**18:
    print(-1)
    sys.exit()
  
print(z)
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
 
for i in range(n):
  print(a.index(i+1)+1 , end=" ")

### FIXED CODE ###

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

s = sorted(range(n), key=lambda x:l[x])

for i in range(n):
  s[i]+= 1
  
print(*s)