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

from collections import defaultdict
from fractions import Fraction
import sys
input = sys.stdin.readline
N=int(input())
mod=10**9+7
dic=defaultdict(lambda: [0,0])
c=0
d=0
e=0
for i in range(N):
 A,B = map(int,input().split())
 if A==0 and B==0:
  e+=1
 elif A==0:
  c+=1
 elif B==0:
  d+=1
 else:
  if Fraction(A,B)>0:
   dic[Fraction(A,B)][0]+=1
  else:
   dic[-1/Fraction(A,B)][1]+=1
ans=1
for k in dic:
 ans*=(pow(2,dic[k][0],mod)+pow(2,dic[k][1],mod) -1)
 ans%=mod
ans*=(pow(2,c,mod)+pow(2,d,mod)-1)
print((ans-1+e)%mod)


### FIXED CODE ###

from collections import defaultdict
from math import gcd
import sys
input = sys.stdin.readline
N=int(input())
mod=10**9+7
dic=defaultdict(lambda: [0,0])
c=0
d=0
e=0
for i in [0]*N:
 A,B = map(int,input().split())
 if A==0 and B==0:
  e+=1
 elif A==0:
  c+=1
 elif B==0:
  d+=1
 else:
  g=gcd(A,B)
  A//=g
  B//=g
  if A*B>0:
   dic[(abs(A),abs(B))][0]+=1
  else:
   dic[(abs(B),abs(A))][1]+=1
ans=1
for k in dic:
 ans=ans*(pow(2,dic[k][0],mod)+pow(2,dic[k][1],mod) -1)
ans=ans*(pow(2,c,mod)+pow(2,d,mod)-1)
print((ans-1+e)%mod)
### BUGGY CODE ###

import sys
S = input()
S_list = list(S)
flag = 1

if len(S) < 2:
    print(0)
    sys.exit()

while flag:
    if len(S_list) == 0:
        break
    tmp = S_list[0]
    count = 0
    for i in range(1, len(S_list)):
        if S_list[i] == tmp and i == len(S_list)-1:
            flag = 0
            break
            
        elif S_list[i] == tmp:
            tmp = S_list[i]
        else:
            S_list.pop(i-1)
            S_list.pop(i-1)
            count += 1
            break

print(len(S)-len(S_list))

### FIXED CODE ###

S = input()
S_list = list(S)

count0 = S_list.count("0")
count1 = S_list.count("1")

print(len(S_list) - abs(count0-count1))
### BUGGY CODE ###

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

one = V[::2]
two = V[1:][::2]

one_count={}
one_len=len(one)
for o in one:
    if o in one_count:
        one_count[o] += 1
    else:
        one_count[o] = 1

for k,v in one_count.items():
    one_count[k] = one_len-v
one_count[10**6]=one_len

two_len=len(two)
two_count={}

for t in two:
    if t in two_count:
        two_count[t] += 1
    else:
        two_count[t] = 1

for k,v in two_count.items():
    two_count[k] = two_len-v
two_count[10**6]=two_len


mins = 1000000

for one_key, one_value in one_count.items():
    for two_key, two_value in two_count.items():
        if one_key != two_key:
            if (one_value + two_value) < mins:
                mins = one_value + two_value
print(mins)

### FIXED CODE ###

import heapq

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

one = V[::2]
two = V[1:][::2]

one,two

one_count={}
one_len=len(one)
for o in one:
    if o in one_count:
        one_count[o] += 1
    else:
        one_count[o] = 1

for k,v in one_count.items():
    one_count[k] = one_len-v
one_count[10**6]=one_len
temp = [[k,v] for k,v in one_count.items()]
one = heapq.nsmallest(3,temp, key=lambda x: x[1])


two_len=len(two)
two_count={}

for t in two:
    if t in two_count:
        two_count[t] += 1
    else:
        two_count[t] = 1

for k,v in two_count.items():
    two_count[k] = two_len-v
two_count[10**6]=two_len
temp = [[k,v] for k,v in two_count.items()]
two = heapq.nsmallest(3,temp, key=lambda x: x[1])

mins = 1000000

for [one_key, one_value] in one:
    for [two_key, two_value] in two:
        if one_key != two_key:
            if (one_value + two_value) < mins:
                mins = one_value + two_value
print(mins)
### BUGGY CODE ###


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

ans = 1
for i in a:
    ans *= i

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


### FIXED CODE ###

def main():
    import sys
    n = int(input())
    a = list(map(int, input().split()))

    try:
        if a.index(0):
            print(0)
            sys.exit()
    except ValueError:
        pass

    ans = 1
    for i in range(n):
        ans *= a[i]
        if ans > 10 ** 18:
            print(-1)
            sys.exit()

    print(ans)


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


def knapsack1(N,W,weight,value):
    inf = float("inf")
    DP = [[-inf]*(W+1) for i in range(N+1)]
    for i in range(W+1): DP[0][i]=0

    for i in range(N):
        for j in range(W+1):
            if j-weight[i] >= 0:
                DP[i+1][j] = chmax(DP[i][j],DP[i][j-weight[i]]+value[i])
            else:
                DP[i+1][j] = chmax(DP[i+1][j],DP[i][j])
    return DP[N][W] 

def chmax(a,b):
    if a > b:
        return a
    else:
        return b

if __name__ == '__main__':
    N,W = map(int,input().split())
    weight = [0]*N
    value = [0]*N
    #print(weight,value)
    for i in range(N):   
        lst = list(map(int,input().split()))
        #print(lst)
        weight[i] = lst[0]
        value[i] = lst[1]
        #max_w += lst[0]
    #print(weight,value)
    ans = knapsack1(N,W,weight,value)
    print(ans)
    #print(max(max(ans)))
    #print(max(ans[-1]))
    

### FIXED CODE ###


def knapsack1(N,W,weight,value):
    inf = float("inf")
    DP = [[-inf]*(W+1) for i in range(N+1)]
    for i in range(W+1): DP[0][i]=0

    for i in range(N):
        for j in range(W+1):
            if j-weight[i] >= 0:
                DP[i+1][j] = chmax(DP[i][j],DP[i][j-weight[i]]+value[i])
            else:
                DP[i+1][j] = chmax(DP[i+1][j],DP[i][j])
    return DP[N][W] 

def chmax(a,b):
    if a > b:
        return a
    else:
        return b

if __name__ == '__main__':
    N,W = map(int,input().split())
    weight = [0]*N
    value = [0]*N
    #print(weight,value)
    for i in range(N):   
        lst = list(map(int,input().split()))
        #print(lst)
        weight[i] = lst[0]
        value[i] = lst[1]
        #max_w += lst[0]
    #print(weight,value)
    ans = knapsack1(N,W,weight,value)
    print(ans)
    #print(max(max(ans)))
    #print(max(ans[-1]))
### BUGGY CODE ###

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

cnt = 0

for i in range(n):
    if min(pp[:i + 1]) >= pp[i]:
        cnt += 1

print(cnt)

### FIXED CODE ###

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

cnt = 0
min_val = 2 * 10 ** 5 + 1

for p in pp:
    if min_val >= p:
        cnt += 1
        min_val = p

print(cnt)
### BUGGY CODE ###

import copy

class UnionFind:
	def __init__(self, N):
		self._parent = [i for i in range(N)]
		self._rank = [0 for i in range(N)]

	def find(self, x):
		if self._parent[x] == x:
			return x
		else:
			return self.find(self._parent[x])

	def unite(self, a, b):
		ta = self.find(a)
		tb = self.find(b)
		if(ta == tb):
			return
		
		if self._rank[ta] < self._rank[tb]:
			self._parent[ta] = tb # make b as a parent of a
		else:
			self._parent[tb] = ta # make a as a parent of b
			if(ta == tb):
				rank[ta] += 1
			
	def check(self, a, b):
		return self.find(a) == self.find(b)
		
if __name__ == '__main__':
	N,K,L = map(int, input().split())
	ans = [0 for _ in range(N)]
	uf1 = UnionFind(N)
	for _ in range(K):
		p,q = map(int, input().split())
		uf1.unite(p-1,q-1)
	uf2 = UnionFind(N)
	for _ in range(L):
		s,r = map(int, input().split())
		uf2.unite(s-1,r-1)
	for i in range(N):
		for j in range(N):
			if uf1.check(i,j) and uf2.check(i,j):
				ans[i] += 1
	print(*ans)

### FIXED CODE ###

import copy

class UnionFind:
	def __init__(self, N):
		self._parent = [i for i in range(N)]

	def find(self, x):
		if self._parent[x] == x:
			return x
		else:
			return self.find(self._parent[x])

	def unite(self, a, b):
		ta = self.find(a)
		tb = self.find(b)
		if(ta != tb):
			self._parent[ta] = min(ta,tb)
			self._parent[tb] = self._parent[ta]
		
			
	def check(self, a, b):
		return self.find(a) == self.find(b)
		
if __name__ == '__main__':
	N,K,L = map(int, input().split())
	uf1 = UnionFind(N)
	for _ in range(K):
		p,q = map(int, input().split())
		uf1.unite(p-1,q-1)
	uf2 = UnionFind(N)
	for _ in range(L):
		s,r = map(int, input().split())
		uf2.unite(s-1,r-1)
	from collections import defaultdict
	d = defaultdict(int)
	for i in range(N):
		d[(uf1.find(i), uf2.find(i))] += 1
	ans = []
	for i in range(N):
		ans.append( str(d[(uf1.find(i), uf2.find(i))]) )
	print(' '.join(ans))
### BUGGY CODE ###

import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.buffer.readline().rstrip()
def resolve():
    n,q=map(int,input().split())
    S,T,X=[0]*n,[0]*n,[0]*n
    D=[0]*q
    for i in range(n):
        S[i],T[i],X[i]=map(int,input().split())
    for j in range(q):
        D[j]=int(input())

    E=[]
    E+=[(s-x,1,x) for s,x in zip(S,X)]
    E+=[(t-x,2,x) for t,x in zip(T,X)]
    E+=[(d,3,i) for i,d in enumerate(D)]
    E.sort()
    from collections import defaultdict
    cnt=defaultdict(int)
    cnt[INF]=1

    from heapq import heappop,heappush
    Q=[INF]
    ans=[-1]*q
    for a,b,c in E:
        if(b==1):
            heappush(Q,c)
            cnt[c]+=1
        elif(b==2): # 本来はここでqからcを削除したいが、できないためb==3で処理する
            cnt[c]-=1
        else:
            while(cnt[Q[0]]==0): # 本来削除されるべき通行止めをここで消す
                heappop(Q)
            x=Q[0]
            if(x!=INF): ans[c]=x
    print(*ans,sep="\n")
resolve()

### FIXED CODE ###

import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.buffer.readline().rstrip()
read = sys.stdin.buffer.read
def resolve():
    n,q=map(int,input().split())
    data = list(map(int,read().split()))
    S = data[:3*n:3]
    T = data[1:3*n:3]
    X = data[2:3*n:3]
    D = data[3*n:]

    E=[]
    E+=[(s-x,1,x) for s,x in zip(S,X)]
    E+=[(t-x,2,x) for t,x in zip(T,X)]
    E+=[(d,3,i) for i,d in enumerate(D)]
    E.sort()
    from collections import defaultdict
    cnt=defaultdict(int)
    cnt[INF]=1

    from heapq import heappop,heappush
    Q=[INF]
    ans=[None]*q
    for a,b,c in E:
        if(b==1):
            heappush(Q,c)
            cnt[c]+=1
        elif(b==2): # 本来はここでqからcを削除したいが、できないためb==3で処理する
            cnt[c]-=1
        else:
            while(cnt[Q[0]]==0): # 本来削除されるべき通行止めをここで消す
                heappop(Q)
            x=Q[0]
            ans[c]=x if(x!=INF) else -1
    print(*ans,sep="\n")
resolve()
### BUGGY CODE ###

#! /usr/bin/env python3

import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)


def isMultiple(s, m):
    tmp = 0
    for i in range(len(s)):
        tmp = (tmp * 10 + int(s[i])) % m
        if tmp == 0:
            return i
    return -1


k = int(readline())
acc = "7" * 10000000
if k % 2 == 0:
    ans = -1
else:

    ans = isMultiple(acc, k) + 1

print(ans)

### FIXED CODE ###

#! /usr/bin/env python3

import sys
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)


def isMultiple(s, m):
    tmp = 0
    for i in range(len(s)):
        tmp = (tmp * 10 + int(s[i])) % m
        if tmp == 0:
            return i
    return -1


k = int(readline())
acc = "7" * 50000000
if k % 2 == 0:
    ans = -1
else:

    ans = isMultiple(acc, k)
    if ans != -1:
        ans += 1

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

def main():
    h,w = map(int,input().split())
    a = {}
    for i in range(h):
        a[i] = input()
    ans = 0
    L = []
    R = []
    D = []
    U = []
    for x in range(h):
        L.append([])
        R.append([])
        for y in range(w):
            if a[x][y] == "#":
                L[x].append(0)
            elif y == 0:
                L[x].append(1)
            else:
                L[x].append(L[x][y-1]+1)
        for y in range(w-1,-1,-1):
            if a[x][y] == "#":
                R[x].append(0)
            elif y == w-1:
                R[x].append(1)
            else:
                R[x].append(R[x][w-y-2]+1)
        R[x].reverse()
    for y in range(w):
        D.append([])
        U.append([])
        for x in range(h):
            if a[x][y] == "#":
                U[y].append(0)
            elif x == 0:
                U[y].append(1)
            else:
                U[y].append(U[y][x-1]+1)
        for x in range(h-1,-1,-1):
            if a[x][y] == "#":
                D[y].append(0)
            elif x == h-1:
                D[y].append(1)
            else:
                D[y].append(D[y][h-x-2]+1)
        D[y].reverse()

    for x in range(h):
        for y in range(w):
            ans = max(ans, R[x][y]+L[x][y]+U[y][x]+D[y][x]-3)
            
    print(ans)
main()


### FIXED CODE ###

def main():
    h,w = map(int,input().split())
    a = {}
    for i in range(h):
        a[i] = input()
    ans = 0
    L = []
    R = []
    D = []
    U = []
    for x in range(h):
        L.append([])
        R.append([])
        for y in range(w):
            if a[x][y] == "#":
                L[x].append(0)
            elif y == 0:
                L[x].append(1)
            else:
                L[x].append(L[x][y-1]+1)
        for y in range(w-1,-1,-1):
            if a[x][y] == "#":
                R[x].append(0)
            elif y == w-1:
                R[x].append(1)
            else:
                R[x].append(R[x][w-y-2]+1)
        R[x].reverse()
    for y in range(w):
        D.append([])
        U.append([])
        for x in range(h):
            if a[x][y] == "#":
                U[y].append(0)
            elif x == 0:
                U[y].append(1)
            else:
                U[y].append(U[y][x-1]+1)
        for x in range(h-1,-1,-1):
            if a[x][y] == "#":
                D[y].append(0)
            elif x == h-1:
                D[y].append(1)
            else:
                D[y].append(D[y][h-x-2]+1)
        D[y].reverse()

    for x in range(h):
        for y in range(w):
            ans = max(ans, R[x][y]+L[x][y]+U[y][x]+D[y][x]-3)
            
    print(ans)
main()
### BUGGY CODE ###

n = int(input())
a = list(map(int,input().split()))
b = list(a)
c = int(n/2)
for j in range(1,c):
    b.remove(max(b))
    b.remove(min(b))
ML = min(b)
MR = max(b)
for i in range(0,n):
    if a[i] >= MR:
        print(ML)
    else:
        print(MR)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
b = list(a)
b.sort()
c = int(n/2)
ML=b[c-1]
MR=b[c]
for i in range(0,n):
    if a[i] >= MR:
        print(ML)
    else:
        print(MR)
### BUGGY CODE ###


N, M = map(int, input().split())
S = input()
T = input()

def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)
 
def lcm(x, y):
    return (x * y) // gcd(x, y)

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

success = False
ans = 0

_lcm = lcm(N, M)
for k in range(1, N*M//_lcm + 1):
    ans = k * _lcm
    s = [(i * ans)//N + 1 for i in range(len(S))]
    t = [(i * ans)//M + 1 for i in range(len(T))]

    pool = s + t

    double_st = [x for x in set(pool) if pool.count(x) > 1]
    isImpossible = False

    for st in double_st:
        s_i = my_index(s, st, -1)
        t_i = my_index(t, st, -1)
        if s_i == -1 or t_i == -1:
            continue
        if S[s_i] != T[t_i]:
            isImpossible = True
            break
            
    if not isImpossible:
        success = True
        break

if not success:
    print(-1)
else:
    print(ans)

### FIXED CODE ###


N, M = map(int, input().split())
S = input()
T = input()

def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)
 
def lcm(x, y):
    return (x * y) // gcd(x, y)

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

success = False
fans = 0

_lcm = lcm(len(S), len(T))

def isImpble(k, _lcm):
    global success
    global S
    global T
    global fans
    
    ans = k * _lcm
    double_st = []
    
    for i in range(len(S)):
        if (len(T)*i)%len(S) == 0 and (len(T) * i)//len(S) <len(T):
            double_st += [(i * ans)//len(S) + 1]
    isImpossible = False

    for st in double_st:
        s_i = ((st-1) * len(S))//ans
        t_i = ((st-1) * len(T))//ans
        if S[s_i] != T[t_i]:
            isImpossible = True
            break

            
    if isImpossible:
        return True
    else:
        success = True
        fans = k*_lcm
        return False
        

imp = isImpble((len(S) * len(T))//_lcm, _lcm)

if not imp:
    for k in range(1, (len(S) * len(T))//_lcm ):
        imp = isImpble(k, _lcm)
        if success:
            break
    

if not success:
    print(-1)
else:
    print(fans)
### BUGGY CODE ###

#!/usr/bin/env python3
def main():
    import numpy as np

    N, K = map(int, input().split())
    # H = [int(x) for x in input().split()] + [0] * K
    H = np.array(input().split(), 'int32')

    INF = 10 ** 10
    # dp = [INF] * (N + K)
    dp = np.full(N, INF, 'int64')
    dp[0] = 0
    # for i in range(N):
    #     target = dp[i]
    #     for k in range(1, K + 1):
    #         res = target + abs(H[i] - H[i + k])
    #         dp[i + k] = res if res < dp[i + k] else dp[i + k]
    for i in range(N):
        target = dp[i]
        for k in range(1, K + 1):
            if i + k >= N:
                break
            res = target + abs(H[i] - H[i + k])
            dp[i + k] = res if res < dp[i + k] else dp[i + k]
        # right = min(i + K, N)
        # dp[i:right] = np.min(dp[i:right], dp[i] + np.abs(H[i] - H[i:right]))
    print(dp[N - 1])


if __name__ == '__main__':
    main()


### FIXED CODE ###

def resolve():
    import sys
    
    readline = sys.stdin.readline

    N, K = map(int, readline().split())
    h = [int(x) for x in readline().split()]

    inf = float('inf')
    dp = [inf] * N
    dp[0] = 0

    for i in range(1, N):
        leng = i + 1 if i < K else K + 1
        for j in range(leng):
            cal = dp[i - j] + abs(h[i] - h[i - j])
            if dp[i] > cal:
                dp[i] = cal

    print(dp[-1])
            

resolve()
### BUGGY CODE ###

from sys import stdin
import math
n = int(stdin.readline())
a = list(map(int,stdin.readline().split()))
a.sort()
ans = 0
seen = set()
for i in range(n):
    for j in range(1,math.floor(math.sqrt(a[i]))+1):
        if a[i]%j == 0:
            x,y = j,a[i]//j
            if x in seen or y in seen:
                break
    else:
        ans += 1 if i == n-1 or a[i] != a[i+1] else 0
    seen.add(a[i])
print(ans)


### FIXED CODE ###

from sys import stdin
import math
n = int(stdin.readline())
a = list(map(int,stdin.readline().split()))
a.sort()
ans = 0
maxval = a[-1]
seen = set()
for i in range(n):
    if a[i] not in seen and (i == n-1 or a[i] != a[i+1]):
        ans += 1
    j = a[i]
    while j <= maxval:
        seen.add(j)
        j += a[i]
print(ans)
### BUGGY CODE ###

import collections
import math
n,m=map(int,input().split())
flag=0
P=[]
p=m
while flag==0:
  cur=p
  for i in range(2,int(p**0.5)+1):
    if p%i==0:
      P.append(i)
      p//=i
      break
  if p==cur:
    P.append(p)
    flag=1
c=collections.Counter(P)
Primes=set(P)
def f(i):
  return math.factorial(i)
def fn(i):
  return f(n+i-1)//(f(n-1)*f(i))%(10**9+7)
ans=1
for p in Primes:
  ans*=fn(c[p])
  ans%=(10**9+7)
print(1 if m==1 else ans) 


### FIXED CODE ###

import collections
import math
n,m=map(int,input().split())
flag=0
P=[]
p=m
while flag==0:
  cur=p
  for i in range(2,int(p**0.5)+1):
    if p%i==0:
      P.append(i)
      p//=i
      break
  if p==cur:
    P.append(p)
    flag=1
c=collections.Counter(P)
Primes=set(P)
def f(i):
  return math.factorial(i)
def fn(i):
  return f(n+i-1)//(f(n-1)*f(i))%(10**9+7)
ans=1
for p in Primes:
  ans*=fn(c[p])
  ans%=(10**9+7)
print(1 if m==1 else ans)
### BUGGY CODE ###

from math import ceil

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

A, B = [], []
for _ in range(N):
    a, b = map(int, input().split())
    A.append(a), B.append(b)
B = sorted(list(filter(lambda x: x > max(A), B)))

count = 0
while H > 0:
    if B:
        H -= B.pop()
    else:
        count += ceil(H / max(A))
        break
    count += 1
print(count)

### FIXED CODE ###

from math import ceil

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

A, B = [], []
for _ in range(N):
    a, b = map(int, input().split())
    A.append(a), B.append(b)
max_a = max(A)
B = sorted(list(filter(lambda x: x > max_a, B)))

count = 0
while H > 0:
    if B:
        H -= B.pop()
    else:
        count += ceil(H / max_a)
        break
    count += 1
print(count)
### BUGGY CODE ###

n,m = map(int, input().split())
start = set()
goal = set()
for i in range(m):
    a,b = map(int, input().split())
    if a == 1:
        start.add(b)
    elif  b == n:
        goal.add(a)

for i in start:
    for j in goal:
        if i == j:
            print("POSSIBLE")
            exit()
print("IMPOSSIBLE")

### FIXED CODE ###

n,m = map(int, input().split())
start = set()
goal = set()
for i in range(m):
    a,b = map(int, input().split())
    if a == 1:
        start.add(b)
    elif  b == n:
        goal.add(a)

ans = start & goal
if len(ans) > 0:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
### BUGGY CODE ###

import numpy as np

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

l = []
for i in range(1, n + 1):
    l.append([i, a[i - 1]])

ln = np.array(l)

lna = ln[np.argsort(ln[:, col_num])]

res = str(lna[0][0])
for i in range(1, n):
    res = res + " " + str(lna[i][0])
print(res)


### FIXED CODE ###

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

l = []
for i in range(1, n + 1):
    l.append([a[i - 1], i])

l.sort()

print(" ".join([str(l[i][1]) for i in range(0, n)]))
### BUGGY CODE ###

import sys
from scipy.sparse.csgraph import dijkstra
from scipy.sparse import csr_matrix
sys.setrecursionlimit(10**7)
n, m = [int(i) for i in sys.stdin.readline().split()]
INF = 10**9
graph = [[1e-10 if j - i == 1 else INF for i in range(n)] for j in range(n)]
for i in range(m):
    l, r, c = [int(i) for i in sys.stdin.readline().split()]
    l -= 1
    r -= 1
    graph[l][r] = c
    graph[r][l] = c
graph = csr_matrix(graph)
res = dijkstra(graph, indices=[0])
print(int(res[0][-1]) if res[0][-1] < INF else -1)

### FIXED CODE ###

import sys
import heapq
sys.setrecursionlimit(10**7)
n, m = [int(i) for i in sys.stdin.readline().split()]
INF = 10**9
graph = {j:[(j-1, 1e-10)] if j > 0 else [] for j in range(n)}
for i in range(m):
    l, r, c = [int(i) for i in sys.stdin.readline().split()]
    l -= 1
    r -= 1
    graph[l].append((r, c))
    graph[r].append((l, c))
que = [(0,0)]
already = set()
res = [-1 for i in range(n)]
while len(que) > 0:
    cost, cand = heapq.heappop(que)
    if cand in already:
        continue
    res[cand] = cost
    already.add(cand)
    for _next, _next_cost in graph[cand]:
        if _next in already:
            continue
        heapq.heappush(que, (cost + _next_cost, _next))
print(int(res[-1]))
### BUGGY CODE ###

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

for ii in range(n):
    print(a.index(ii+1)+1)



### FIXED CODE ###

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

a_new = sorted(range(len(a)), key=lambda k: a[k])
for ii in range(n):
    print(a_new[ii]+1)
### BUGGY CODE ###

n,k = map(int,input().split())
p = list(map(float,input().split()))

for i in range(n) :
  p[i] = (p[i]+1)/2

ans = 0
for i in range(n-k+1) :
  ans = max(ans,sum(p[i:k+i]))
  
print(ans)

### FIXED CODE ###

n,k = map(int,input().split())
p = list(map(float,input().split()))

for i in range(n) :
  p[i] = (p[i]+1)/2

# ans[i] = iを含めてk個前までの期待値の総和
ans = [0 for i in range(n)]
ans[k-1] = sum(p[0:k])
for i in range(k,n) :
  ans[i] = ans[i-1] + p[i] - p[i-k]
  
print(max(ans))