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

N = int(input())
As = list(map(int, input().split()))
modNum = 10**9 + 7
sum = 0
for i in range(N-1):
	for j in range(i+1, N):
		sum += As[i] ^ As[j]
print(sum % modNum)

### FIXED CODE ###

import numpy as np
N = int(input())
As = np.array(list(map(int, input().split())))
modNum = 10**9 + 7
sum = 0
for d in range(60):
	n1 = np.count_nonzero((As >> d) & 1 == 1)
	sum += (2 ** d) * n1 * (N - n1)
print(sum % modNum)
### BUGGY CODE ###

import sys
from collections import deque

S = input()
Q = int(input())
QUERY = sys.stdin.readlines()

state = 0
q1 = ''
q2 = ''
for i in range(Q):
    query = QUERY[i]
    if query[0] == '1':
        state ^= 1
    else:
        _, F, C = query.split()
        if (state + int(F)) % 2:
            q1 += C
        else:
            q2 += C

ans = ''
if state == 0:
    ans += ''.join(list(reversed(q1)))
    ans += S
    ans += q2
else:
    ans += ''.join(list(reversed(q2)))
    ans += ''.join(list(reversed(S)))
    ans += q1
print(ans)


### FIXED CODE ###

import sys

S = input()
Q = int(input())
QUERY = sys.stdin.readlines()

state = 0
q1 = ''
q2 = ''
for i in range(Q):
    query = QUERY[i]
    if query[0] == '1':
        state ^= 1
    else:
        _, F, C = query.split()
        if (state + int(F)) % 2:
            q1 += C
        else:
            q2 += C

ans = ''
if state == 0:
    print(q1[::-1], end='')
    print(S, end='')
    print(q2)
else:
    print(q2[::-1], end='')
    print(S[::-1], end='')
    print(q1)
### BUGGY CODE ###

#!/usr/bin/env python3
import sys


def II(): return int(sys.stdin.readline())


def MI(): return map(int, sys.stdin.readline().split())


def LI(): return list(map(int, sys.stdin.readline().split()))


def main():
    N = II()
    A = LI()
    A.sort()
    MAX = 10**6+1
    All = [0] * MAX

    setA = set(A)
    for i in A:
        k = i
        All[k] += 1
        k += i
        if All[i] == 2:
            continue
        while k < MAX and i in setA:
            All[k] += 1
            k += i

    ans = 0
    for i in range(1, MAX):
        if All[i] == 1 and i in setA:
            ans += 1

    print(ans)

    # oj t -c "pypy3 main.py"
    # acc s main.py -- --guess-python-interpreter pypy
main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys


def II(): return int(sys.stdin.readline())


def MI(): return map(int, sys.stdin.readline().split())


def LI(): return list(map(int, sys.stdin.readline().split()))


def main():
    N = II()
    A = LI()
    A.sort()
    MAX = A[-1]+1
    All = [0 for i in range(MAX)]

    setA = set(A)
    for i in A:
        k = i
        All[k] += 1
        k += i
        if All[i] == 2:
            continue
        while k < MAX and i in setA:
            All[k] += 1
            k += i

    ans = 0
    for i in range(1, MAX):
        if All[i] == 1 and i in setA:
            ans += 1

    print(ans)

    # oj t -c "pypy3 main.py"
    # acc s main.py -- --guess-python-interpreter pypy
main()
### BUGGY CODE ###

import itertools

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

pos = [i for i in range(1,N+1)]
ways = list(itertools.combinations(pos,2))

dist_l = [min(abs(i-j), abs(i - X) + 1 + abs(Y - j)) for i,j in ways]

for k in range(1,N):
    print(dist_l.count(k))

### FIXED CODE ###

import itertools
import collections

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

pos = [i for i in range(1,N+1)]
ways = list(itertools.combinations(pos,2))

dist_l = [min(abs(i-j), abs(i - X) + 1 + abs(Y - j)) for i,j in ways]

dic = collections.Counter(dist_l)
for i in range(1,N):
    print(dic[i])
### BUGGY CODE ###

import sys
from collections import deque
readline = sys.stdin.readline

N = int(readline())
P = list(map(int, readline().split()))

geta = N+2
G = [0]*(geta*geta)

for v in range(-1-(-N//2), -1, -1):
    l = v+1
    r = N-v
    for i in range(geta):
        G[i*geta+l] = v
        G[i*geta+r] = v
        G[l*geta+i] = v
        G[r*geta+i] = v

for i in range(geta):
    G[i*geta] = -1
    G[i*geta + geta-1] = -1
    G[i] = -1
    G[geta*(geta-1)+i] = -1

Pn = []

for p in P:
    a, b = divmod(p-1, N)
    Pn.append((1+a)*geta+1+b)

DIREC = [1, -1, geta, -geta]
ans = 0
used = [False]*(geta*geta)
for p in Pn:
    ans += G[p]
    res = G[p]
    for d in DIREC:
        res = min(res, G[p+d])
    if G[p] != res:
        G[p] = res
        Q = [p]
        while Q:
            vn = Q.pop()
            for d in DIREC:
                vf = vn + d
                if not used[vf]:
                    if G[vf] > G[vn] + 1:
                        G[vf] = G[vn] + 1
                        Q.append(vf)
                else:
                    if G[vf] > G[vn]:
                        G[vf] = G[vn]
                        Q.append(vf)
                    
    used[p] = True
print(ans)

### FIXED CODE ###

import sys
from collections import deque
readline = sys.stdin.readline

N = int(readline())
P = list(map(int, readline().split()))

geta = N+2
G = [0]*(geta*geta)

for v in range(-1-(-N//2), -1, -1):
    l = v+1
    r = N-v
    for i in range(geta):
        G[i*geta+l] = v
        G[i*geta+r] = v
        G[l*geta+i] = v
        G[r*geta+i] = v

for i in range(geta):
    G[i*geta] = -1
    G[i*geta + geta-1] = -1
    G[i] = -1
    G[geta*(geta-1)+i] = -1

Pn = []

for p in P:
    a, b = divmod(p-1, N)
    Pn.append((1+a)*geta+1+b)

DIREC = (1, -1, geta, -geta)
ans = 0
used = [False]*(geta*geta)
for p in Pn:
    ans += G[p]
    res = G[p]
    for d in DIREC:
        res = min(res, G[p+d])
    if G[p] != res:
        G[p] = res
        Q = [p]
        while Q:
            vn = Q.pop()
            for d in DIREC:
                vf = vn + d
                if not used[vf]:
                    if G[vf] > G[vn] + 1:
                        G[vf] = G[vn] + 1
                        Q.append(vf)
                else:
                    if G[vf] > G[vn]:
                        G[vf] = G[vn]
                        Q.append(vf)
                    
    used[p] = True
print(ans)
### BUGGY CODE ###

def merge(A,B):
    C = []
    
    while len(A)!=0 and len(B) != 0:
        if A[0]>B[0]:
            C.append(A[0])
            del A[0]
        else:
            C.append(B[0])
            del B[0]

    if len(A)>len(B):
        C.extend(A)
    else:
        C.extend(B)

    return C

if __name__ == "__main__":
    X,Y,A,B,C = map(int,input().split())
    P = list(map(int,input().split()))
    Q = list(map(int,input().split()))
    R = list(map(int,input().split()))

    # 後で消す
    # P = [1,23,4,1,2]
    # Q = [4,3,56]
    # R = [70,20,1]

    P.sort(reverse=True)
    Q.sort(reverse=True)
    R.sort(reverse=True)

    S = merge(P[:X],Q[:Y])
    S = merge(S,R)
    
    score = 0
    for i in range(X+Y):
        score += S[i]
    print(score)



### FIXED CODE ###

def merge(A,B):
    C = []
    i = 0
    j = 0
    while i < len(A) and j < len(B):
        if A[i]>B[j]:
            C.append(A[i])
            i += 1
        else:
            C.append(B[j])
            j += 1

    if len(A)-i>len(B)-j:
        C.extend(A[i:])
    else:
        C.extend(B[j:])

    return C

X,Y,A,B,C = map(int,input().split())
P = list(map(int,input().split()))
Q = list(map(int,input().split()))
R = list(map(int,input().split()))

# P = [3,63,12,5,6]
# Q = [3,5,6,7,8]
# R = [13,5,6,8,23,5]
# X = 3
# Y = 2

# P = [63,12,6]
# Q = [8,7]

# i = 2
# j = 2
# C = [63,12,8,7]


P.sort(reverse=True)
Q.sort(reverse=True)
R.sort(reverse=True)

S = merge(P[:X],Q[:Y])
S = merge(S,R)

score = 0
for i in range(X+Y):
    score += S[i]
print(score)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for _ in range(j)] for _ in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from itertools import accumulate #list(accumulate(A))

H, W = mi()
S = [li() for _ in range(H)]
flag = [[0]*W for _ in range(H)]
flag_odd = [[0]*W for _ in range(H)]
odd_l = []

for i in range(H):
    for j in range(W):
        if S[i][j] % 2:
            odd_l.append([i, j])
            flag_odd[i][j] = 1

odd_l = sorted(odd_l, key = lambda x:(x[0], x[1]))

#print(odd_l)
num_odd = len(odd_l)

ans = []
for si, sj in odd_l[:(num_odd//2)*2]:
    if not flag_odd[si][sj]:
        continue
    flag_odd[si][sj] = 0
    flag[si][sj] = 1
    while True:
        if si+1 < H and not flag[si+1][sj]:
            si += 1
            flag[si][sj] = 1
            ans.append([si-1, sj, si, sj])
        if sj+1 < W and not flag[si][sj+1]:
            sj += 1
            flag[si][sj] = 1
            ans.append([si, sj-1, si, sj])
        if flag_odd[si][sj] == 1:
            flag_odd[si][sj] = 0
            break

print(len(ans))
for si, sj, ti, tj in ans:
    print(si+1, sj+1, ti+1, tj+1)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for _ in range(j)] for _ in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from itertools import accumulate #list(accumulate(A))

H, W = mi()
S = [li() for _ in range(H)]
f = 0
ans = []

for j in range(W):
    if not j%2:
        for i in range(H):
            if f:
                ans.append([pi, pj, i+1, j+1])
            if S[i][j] % 2:
                f = 1 - f
            pi, pj = i+1, j+1
    if j%2:
        for i in reversed(range(H)):
            if f:
                ans.append([pi, pj, i+1, j+1])
            if S[i][j] % 2:
                f = 1 - f
            pi, pj = i+1, j+1


N = len(ans)
print(N)
for i in range(N):
    print(ans[i][0], ans[i][1], ans[i][2], ans[i][3])
### BUGGY CODE ###

N = int(input())

ppl = list(input())


buff = []

for i in range(N):
    n = ppl[:i].count('W') + ppl[i+1:].count('E')
    buff.append(n)

print(min(buff))

### FIXED CODE ###

N = int(input())

ppl = list(input())

buff = []
w = 0
e = ppl[1:].count('E')
for i in range(N):
    if i > 0:
        w += (ppl[i-1] == 'W' and 1 or 0)
    if i > 0:
        e -= (ppl[i] == 'E' and 1 or 0)
    n = w+e
    buff.append(n)

print(min(buff))
### BUGGY CODE ###

import sys
from collections import deque

inf = float('inf')

n, x, y = map(int, sys.stdin.readline().split())
g = [[] for _ in range(n)]
for i in range(n-1):
    g[i].append(i+1)
    g[i+1].append(i)
g[x-1].append(y-1)
g[y-1].append(x-1)

def bfs(i):
    dist = [inf] * n
    dist[i] = 0
    q = deque()
    q.append((i, 0))
    visited = set()

    while q:
        x, d = q.popleft()
        dist[x] = min(dist[x], d)
        visited.add(x)
        for y in g[x]:
            if y in visited:
                continue
            q.append((y, d+1))
    return dist
        

def main():
    res = [0] * (n + 1)
    for i in range(n):
        dist = bfs(i)
        for d in dist:
            res[d] += 1
    for c in res[1:-1]:
        print(c // 2)

if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
from itertools import combinations

n, x, y = map(int, sys.stdin.readline().split())
    
def main():
    res = [0] * (n + 1)
    for i, j in combinations(range(1, n+1), 2):
        d = min(j - i, abs(i - x) + 1 + abs(j - y))
        res[d] += 1
        
    for i in range(1, n):
        print(res[i])

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

from itertools import product
N,A = (int(T) for T in input().split())
X = [int(T) for T in input().split()]
Count = 0
for TB in product([0,1],repeat=N):
    Card = list(TB)
    UseN = sum(Card)
    if A*UseN==sum(TX*TC for TX,TC in zip(X,Card)) and UseN>=1:
        Count += 1
print(Count)

### FIXED CODE ###

N,A = (int(T) for T in input().split())
X = [int(T) for T in input().split()]
DP = [[[0]*(N+1) for TS in range(0,50*N+1)] for TI in range(0,N+1)]
DP[0][0][0] = 1
for TI in range(0,N):
    for TS in range(0,50*N+1):
        for TK in range(0,N+1):
            if DP[TI][TS][TK]!=0:
                DP[TI+1][TS][TK] += DP[TI][TS][TK]
                DP[TI+1][TS+X[TI]][TK+1] += DP[TI][TS][TK]
print(sum(DP[N][A*TA][TA] for TA in range(1,N+1)))
### BUGGY CODE ###

import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 998244353

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

#################

N,S = LI()
A = LI()

beki = [1]*(N+1)
for i in range(1,N+1):
    beki[i] = beki[i-1]*2
    beki[i] %= mod

inv2 = pow(2,mod-2,mod)

d = [0]*(S+1)
d[0] = beki[N]

ans = 0
for i in range(N):
    if 0 <= S-A[i] <= S:
        ans += d[S-A[i]]*inv2
        ans %= mod
    diff = [0]*(S+1)
    for k in range(S-A[i]+1):
        diff[k+A[i]] = d[k]*inv2
    for k in range(S+1):
        d[k] += diff[k]

print(ans)

### FIXED CODE ###

import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 998244353

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

#################

N,S = LI()
A = LI()

beki = [1]*(N+1)
for i in range(1,N+1):
    beki[i] = beki[i-1]*2
    beki[i] %= mod

inv2 = pow(2,mod-2,mod)

d = [0]*(S+1)
d[0] = beki[N]

ans = 0
for i in range(N):
    if 0 <= S-A[i] <= S:
        ans += d[S-A[i]]*inv2
        ans %= mod
    diff = [0]*(S+1)
    for k in range(S-A[i]+1):
        diff[k+A[i]] = d[k]*inv2
    for k in range(S+1):
        d[k] += diff[k]
        d[k] %= mod

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

import sys
import time
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
N = int(input())

groups = []

def dfs(s, n):
    if n == N:
        bits = [-1] * N
        for i, ss in enumerate(s):
            if bits[i] != -1:
                continue
            for ii in range(i+1, N):
                if s[ii] == ss:
                    bits[ii] = i
        if bits not in groups:
            groups.append(bits)
            print(s)
        return
    for ns in 'abcdefghijklmnopqrstuvwxyz'[:n+1]:
        dfs(s+ns, n+1)

dfs('', 0)


### FIXED CODE ###

import sys
import time
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
N = int(input())

def dfs(s, n, m):
    if n > N:
        print(''.join([chr(ss) for ss in s]))
        return True
    for ns in range(97, m+2):
        s[n-1] = ns
        dfs(s, n+1, max(m, ns))

s = [0] * N
dfs(s, 1, 96)
### BUGGY CODE ###

from collections import Counter
n = int(input())
s = [Counter(input()) for _ in range(n)]
ans = 0
for i in range(n-1):
    for j in range(i+1, n):
        if s[i]==s[j]:
            ans += 1
print(ans)


### FIXED CODE ###

from collections import Counter
n = int(input())
s = [tuple(sorted(input())) for _ in range(n)]

c = Counter(s)
ans = 0
for i in c.values():
    ans += i*(i-1)//2
print(ans)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(4100000)
input = sys.stdin.readline
from collections import deque

n,m = map(int,input().split())
g = [[] * n for i in range(n)]
for i in range(m):
    u, v = map(int, input().split())
    u -= 1
    v -= 1
    g[u].append(v)
    g[v].append(u)
    
ans = [-1]*n
cnt = [n]*n
def dfs(now, prev,c):
    for next in g[now]:
        if next != prev and next!=0:
          if cnt[next] > c:
            ans[next] = now+1
            cnt[next] = c
            dfs(next, now,c+1)
            
dfs(0,-1,1)

for i in ans[1:]:
  if i == -1:
    print('No')
    exit()
print('Yes')
for i in ans[1:]:
  print(i)

### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from collections import deque

n,m = map(int,readline().split())
g = [[] * n for i in range(n)]
for i in range(m):
    u, v = map(int,readline().split())
    u -= 1
    v -= 1
    g[u].append(v)
    g[v].append(u)
    
ans = [-1]*n
from collections import deque

que = deque()
que.append((0,1))
chk = [False]*n
chk[0] =True
cnt = 1
while que:
    now,p = que.popleft()
    if cnt == n:
      break
    for i in g[now]:
        if not chk[i]:
          ans[i] = p
          chk[i] = True
          cnt += 1
          que.append((i,i+1))

if cnt!=n:
  print('No')
  exit()
  
print('Yes')
for i in ans[1:]:
  print(i)
### BUGGY CODE ###

n,a,b,c,d,e = int(input()),int(input()),int(input()),int(input()),int(input()),int(input())
p = [n,0,0,0,0,0]
def time(q):
    change = []
    if q[0] < a:
        change.append(q[0])
    else:
        change.append(a)
    if q[1] < b:
        change.append(q[1])
    else:
        change.append(b)
    if q[2] < c:
        change.append(q[2])
    else:
        change.append(c)
    if q[3] < d:
        change.append(q[3])
    else:
        change.append(d)
    if q[4] < e:
        change.append(q[4])
    else:
        change.append(e)
    q[0] += change[0]
    q[1] += change[0]-change[1]
    q[2] += change[1]-change[2]
    q[3] += change[2]-change[3]
    q[4] += change[3]-change[4]
    q[5] += change[4]
count = 0
while p[5] < n:
    time(p)
    count += 1
print(count)

### FIXED CODE ###

import math
N,A,B,C,D,E = int(input()),int(input()),int(input()),int(input()),int(input()),int(input())
print(math.ceil(N/min(A,B,C,D,E)+4))
### BUGGY CODE ###

N=input()
A=[int(x)for x in input().split()]
B=[0]
count=0
for x in A:
  i=B[-1]+x
  B.append(i)
  c=B.count(i)
  if c >1:
    count+=c-1
print(count)

### FIXED CODE ###

import collections
N=input()
A=[int(x)for x in input().split()]
B=[0]
count=0
for x in A:
  i=B[-1]+x
  B.append(i)

dic=collections.Counter(B)
for key,c in dic.items():
  count+=c*(c-1)//2
print(count)
### BUGGY CODE ###

def main():
    n, k = [int(e) for e in input().split()]
    A = [int(e) for e in input().split()]

    s = A[0]
    for i in range(1, k):
        s *= A[i]

    prev = s
    for i in range(n - k):
        s //= A[i]
        s *= A[k + i]

        if prev < s:
            print('Yes')
        else:
            print('No')

        prev = s


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    n, k = [int(e) for e in input().split()]
    A = [int(e) for e in input().split()]

    for i in range(n - k):
        if A[i] < A[k + i]:
            print('Yes')
        else:
            print('No')


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

#!/usr/bin/env python3
import sys


def solve(n: int, a: "List[int]"):
    l = []
    for i in range(n):
        l.append(a[i])
        l.reverse()

    l = map(str, l)
    print(' '.join(l))
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    n = int(next(tokens))  # type: int
    a = [ int(next(tokens)) for _ in range(n) ]  # type: "List[int]"
    solve(n, a)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys


def solve(n: int, a: "List[int]"):
    from collections import deque

    d = deque()
    for i in range(n):
        if(i%2 == 0):
            d.append(a[i])
        else:
            d.appendleft(a[i])

    if(n%2 == 1):
        d.reverse()

    d = map(str, d)
    print(' '.join(d))
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    n = int(next(tokens))  # type: int
    a = [ int(next(tokens)) for _ in range(n) ]  # type: "List[int]"
    solve(n, a)

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

N,Y = map(int,input().split())
flag = False
ans = ""
for x in range(N + 1):
  if flag:
    break
  for y in range(N + 1):
    if x + y > N or flag:
      break
    for z in range(N + 1):
      if x + y + z > N or flag:
        break
      if x * 10000 + y * 5000 + z * 1000 == Y and x + y + z == N:
        ans = str(x) + " " + str(y) + " " + str(z)
        flag = True
if flag:
  print(ans)
else:
  print("-1 -1 -1")

### FIXED CODE ###

N,Y = map(int,input().split())
flag = False
ans = ""
for x in range(N + 1):
  if flag:
    break
  for y in range(N + 1):
    if x + y > N or flag:
      break
    if x*10000+y*5000+(N-x-y)*1000 == Y:
      ans = str(x) + " " + str(y) + " " + str(N-x-y)
      flag = True
if flag:
  print(ans)
else:
  print("-1 -1 -1")
### BUGGY CODE ###

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

for i in range(1,N+1):
  print(A.index(i)+1, end=" ")

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
AA = [0 for i in range(N)]
 
for i in range(N):
  AA[A[i]-1] = i + 1
  
L=[str(a) for a in AA]
L=" ".join(L)
print(L)
### BUGGY CODE ###

import numpy as np

def bubble_sort(arr):
    change = True
    while change:
        change = False
        for i in range(len(arr) - 1):
            if arr[i] > arr[i + 1]:
                arr[i], arr[i + 1] = arr[i + 1], arr[i]
                change = True
    return arr

n = int(input())

buf = []
cnt = []

for i in range(n):
    buf2 = input()
    if buf2 not in buf:
        buf.append(buf2)
        cnt.append(0)
    cnt[buf.index(buf2)] += 1

aaa = max(cnt)
ans2 = np.array(buf)[np.array(cnt) == aaa]
ans3 = bubble_sort(ans2)

for i in ans3:
    print(i)

### FIXED CODE ###

n = int(input())
s = []

for i in range(n):
    s.append(input())

word_buf = {}

for i in s:
    if i in word_buf.keys():
        word_buf[i] += 1
    else:
        word_buf[i] = 1

max_cnt = max(word_buf.values())
max_word = [i[0] for i in word_buf.items() if i[1] == max_cnt]
max_word.sort()

for i in max_word:
    print(i)
### BUGGY CODE ###

import sys
#input = sys.stdin.readline
sys.setrecursionlimit(1000000)
n, q = map(int, input().split())

trees = [ [] for i in range(n+1) ]
for i in range(n-1):
    a, b = map(int, input().split())
    trees[a].append(b)
    trees[b].append(a)

values = [ 0 for i in range(n+1) ]
for i in range(q):
    p, x = map(int, input().split())
    values[p] += x
#print(values)

def dfs2(i, parent):
    for j in trees[i]:
        if j == parent: continue
        values[j] += values[i]
        dfs2(j, i)

dfs2(1, -1)
print(*values[1:])

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
n, q = map(int, input().split())
 
ki = [[] for i in range(n + 1)]
for i in range(n - 1):
    a, b = map(int, input().split())
    ki[a].append(b)
    ki[b].append(a)
# print(ki)
 
cnt = [0] * (n + 1)
for i in range(q):
    p, x = map(int, input().split())
    cnt[p] += x
 
 
# print(cnt)
 
 
def d(y, parent):
    for i in ki[y]:
        if i == parent:
            continue
        cnt[i] += cnt[y]
        d(i, y)
 
 
d(1, -1)
print(*cnt[1:])
### BUGGY CODE ###

k=int(input())
 
ans=-1
init=7
for i in range(k+1):
  if init%k ==0:
    ans=i+1
    break
  init = init*10+7
print(ans)

### FIXED CODE ###

k=int(input())
 
ans=-1
init=7
for i in range(k+1):
  if init%k ==0:
    ans=i+1
    break
  init = (init*10+7)%k
print(ans)