Harryxun/stf_run huggingface dataset:
import fractions

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

"""

X+0D
X+1D
X+2D
...
X+(N-1)D

からとってくる

aX + bD

aX中にlcmがtこあるとき、 newa = (aX-t*lcm) // X = a - t*lcm//X
newl += lcm*t // D

で、aX > lcm(X,D)だったらaをへらして?の範囲をうしろにずらす
各aについて計算量はO(1)

3,4,2のとき
4
6
8
lcm = 4

0,4,6,8,10,12,14,18

XD両方負だと問題なし
Dが負の時 >> 大事なのは aXを変換できるならDにする>aを減らす

"""

l = [ [] for i in range(N+1)]
r = [ [] for i in range(N+1)]
lcm = X*D // fractions.gcd(X,D)


bl = 0
br = 0


for a in range(N+1):


    if a > 0:
        bl += a-1
        br += N-a

    #print (bl,br)

    t = (a*X) // lcm
    #print (a,t*lcm//X)
    a -= t*lcm // X

    l[a] .append(bl + lcm*t // D)
    r[a] .append(br + lcm*t // D)

ans = 0

for a in range(N+1):

    now = 0
    nl = 0
    lind = 0
    rind = 0
    
    for i in range(2 * len(l[a])):

        if rind == len(r[a]) or (lind != len(l[a]) and l[a][lind] <= r[a][rind]):
            if now == 0:
                nl = l[a][lind]
            now += 1
            lind += 1
        else:
            now -= 1
            if now == 0:
                ans += r[a][rind] - nl + 1
            rind += 1
        
        

#print (l)
#print (r)
print (ans)


### FIXED CODE ###

import fractions
import sys

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

"""

X+0D
X+1D
X+2D
...
X+(N-1)D

からとってくる

aX + bD

aX中にlcmがtこあるとき、 newa = (aX-t*lcm) // X = a - t*lcm//X
newl += lcm*t // D

で、aX > lcm(X,D)だったらaをへらして?の範囲をうしろにずらす
各aについて計算量はO(1)

3,4,2のとき
4
6
8
lcm = 4

0,4,6,8,10,12,14,18

XD両方負だと問題なし
Dが負の時 >> 大事なのは aXを変換できるならDにする>aを減らす
?X > !Dにする

X  D
3 -3

X + 0D = 3
X + 1D = 0

0X = 0
1X + 

lcm = 3
なので,0は X+-1Dに変換可能

0 100 200 300

"""

if X == 0 and D == 0:
    print (1)
    sys.exit()
elif D == 0:
    print (N+1)
    sys.exit()
elif X == 0:
    print (N * (N-1) // 2 + 1 )
    sys.exit()

l = [ [] for i in range(N+1)]
r = [ [] for i in range(N+1)]
lcm = X*D // fractions.gcd(X,D)


bl = 0
br = 0


for a in range(N+1):


    if a > 0:
        bl += a-1
        br += N-a

    #print (bl,br)

    t = (a*X) // lcm
    #print (a,t*lcm//X)
    a -= t*lcm // X

    l[a] .append(bl + lcm*t // D)
    r[a] .append(br + lcm*t // D)

ans = 0


for a in range(N+1):

    now = 0
    nl = 0
    lind = 0
    rind = 0
    l[a].sort()
    r[a].sort()
    
    for i in range(2 * len(l[a])):

        if rind == len(r[a]) or (lind != len(l[a]) and l[a][lind] <= r[a][rind]):
            if now == 0:
                nl = l[a][lind]
            now += 1
            lind += 1
        else:
            now -= 1
            if now == 0:
                ans += r[a][rind] - nl + 1
            rind += 1
        
 

#print (l)
#print (r)
print (ans)
S=input()
S1=int(S)
#print(len(S))
S_count=len(S)
sum=0
sum1=0
ii=0
jj=4
SSSS=int(S_count)
for i in range(S_count):
  sum1+=i
#print(sum1)
for i in range(sum1):
  if ii==int(S_count-1):
    break
  SS=S[ii:jj]
  #print(SS)
  SSS=int(SS)
  if SSS%2019==0:
    sum+=1
  jj+=1
  if jj==int(S_count+1):
    ii+=1
    if ii>=4:
      jj=ii+1
    else:
      jj=4
  
print(sum)

### FIXED CODE ###

S,W=map(int,input().split())
if(S<=W):
  print("unsafe")
else:
  print("safe")
from collections import defaultdict

M = 998244353
B = pow(10, 18, M)
N = int(input())

def geometric_mod(a, r, m, n):
  x = a
  for i in range(n):
    yield x
    x = (x*r)%m

BB = list(geometric_mod(1, B, M, N+2))

def ext_euc(a, b):
  x1, y1, z1 = 1, 0, a
  x2, y2, z2 = 0, 1, b
  while z1 != 1:
    d, m = divmod(z2,z1)
    x1, x2 = x2-d*x1, x1
    y1, y2 = y2-d*y1, y1
    z1, z2 = m, z1
  return x1, y1

def inv_mod(a, b, m):
  x, y = ext_euc(a, m)
  return (x * b % m)

def mex(s):
  for i in range(N+1):
    if i not in s:
      return i

def calc_grundy(e):
  e = set(e)
  g = {}
  sum_g = defaultdict(int)
  sum_g[0] = inv_mod(B-1, pow(B, N+1, M)-B, M)
  for i in range(N, 0, -1):
    if i not in e:
      continue
    m = mex({g.get(j, 0) for j in e[i]})
    if m:
      g[i] = m
      sum_g[g[i]] = (sum_g[g[i]] + BB[i]) % M
      sum_g[0]  = (sum_g[0] - BB[i]) % M

  return sum_g

def read_edge():
  M = int(input())
  e = defaultdict(list)
  for i in range(M):
    a, b = sorted(map(int, input().split()))
    e[a].append(b)
  return e

def solve(N, edge):
  sum_g = list(map(calc_grundy, edge))
  ret = 0
  for gx, sx in sum_g[0].items():
    for gy, sy in sum_g[1].items():
      gz = gx^gy
      sz = sum_g[2][gz]
      if sz:
        ret = (ret + sx*sy*sz) % M
  return ret


edge = [read_edge() for i in range(3)]

print(solve(N, edge))

### FIXED CODE ###

from collections import defaultdict

M = 998244353
B = 10**18 % M

def mex(s):
  for i in range(max(s)+2):
    if i not in s:
      return i

def ext_euc(a, b):
  x1, y1, z1 = 1, 0, a
  x2, y2, z2 = 0, 1, b
  while z1 != 1:
    d, m = divmod(z2,z1)
    x1, x2 = x2-d*x1, x1
    y1, y2 = y2-d*y1, y1
    z1, z2 = m, z1
  return x1, y1

def inv_mod(a, b, m):
  x, y = ext_euc(a, m)
  return (x * b % m)

def calc_grundy(e):
  g = {}
  sum_g = defaultdict(int)
  sum_g[0] = inv_mod(B-1, pow(B, N+1, M)-B, M)
  for i in sorted(e.keys(), reverse=True):
    m = mex({g.get(j,0) for j in e[i]})
    if m:
      g[i] = m
      x = pow(B, i, M)
      sum_g[m] += x
      sum_g[0] -= x
  return sum_g

def get_edge():
  M = int(input())
  e = defaultdict(set)
  for i in range(M):
    a, b = sorted(map(int, input().split()))
    e[a].add(b)
  return e

def solve(N, edge):
  sum_g = list(map(calc_grundy, edge))
  ret = 0
  for gx, x in sum_g[0].items():
    for gy, y in sum_g[1].items():
      gz = gx^gy
      z = sum_g[2][gz]
      ret = (ret + x*y*z)%M
  return ret

N = int(input())
edge = [get_edge() for i in range(3)]

print(solve(N, edge))
s = input()
n = int(input())
for i in ragne(n):
    cmd = input().split()
    a,b = map(int,[cmd[1],cmd[2]])
    if cmd[0][0] == 'p':print(s)
    elif cmd[0] =='replace':
        s = s[:a] + cmd[3] + s[b+1:]
    elif cmd[0] =='reverse':
        s = s[:a] + s[a:b+1][::-1] + s[b+1:]

### FIXED CODE ###

s = input()
n = int(input())
for i in range(n):
    cmd = input().split()
    a,b = map(int,[cmd[1],cmd[2]])
    if cmd[0] == 'print':print(s[a:b+1])
    elif cmd[0] == 'reverse':s = s[:a] + s[a:b+1][::-1] + s[b+1:]
    elif cmd[0] == 'replace':s = s[:a] + cmd[3] + s[b+1:]
import sys
import math


N, X = 3,3
A = [1,7,11]

if N == 1:
    print(A[0]-X)
    sys.exit()

A.append(X)
A = sorted(A)

anslis = [0]*N

for i in range(N):
    anslis[i] = A[i+1] - A[i]

g = anslis.pop(0)
for c in cost_li:
    g = math.gcd(g,c)

print(g)

### FIXED CODE ###

import sys
import math


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

A.append(X)
A = sorted(A)

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

g = anslis.pop(0)
for c in anslis:
    g = math.gcd(g,c)

print(g)
N,X = (int(i) for i in input().split()) 
L = [int(i) for i in input().split()] 
D=0
i=0
while(D<=X):
  D=D+L[i]
  i=i+1
print(i+1)

### FIXED CODE ###

N, X = map(int, input().split())
L = list(map(int, input().split()))
count = 1
line = 0
for i in range(N):
    line += L[i]
    if line <= X:
        count += 1
print(count)
N=int(input())
h=list(map(int,input().split()))
ans=0
flag = False
for hei in range(1,101):
  for i in range(N+1):
    if h[i] >= hei and i!=N:
      flag = True
    else:
      if flag:
        ans+=1
        flag = False
print(ans)

### FIXED CODE ###

N=int(input())
h=list(map(int,input().split()))
h.append(0)
ans=0
flag = False
for hei in range(1,101):
  for i in range(N+1):
    if h[i] >= hei and i!=N:
      flag = True
    else:
      if flag:
        ans+=1
        flag = False
print(ans)
def main()
  while True:
    m = int(input())
    if not m: break
    seiza = []
    for i in range(m):
      seiza.append(list(map(int,input().split())))
    kijun = seiza.pop(0)
    
    n = int(input())
    hosi = []
    point = {}
    
    for i in range(n):
      x,y = map(int,input().split())
      point[x,y] = 1
      hosi.append([x,y])
  
    for a in hosi:
      dx,dy = a[0] - kijun[0], a[1] - kijun[1]
      for b in seiza:
        if not (b[0] + dx, b[1] + dy) in point:
          break
      else:
        print(dx,dy)
        break
main() 


### FIXED CODE ###

def main():
  while True:
    m = int(input())
    if not m: break
    seiza = []
    for i in range(m):
      seiza.append(list(map(int,input().split())))
    kijun = seiza.pop(0)
    
    n = int(input())
    hosi = []
    point = {}
    
    for i in range(n):
      x,y = map(int,input().split())
      point[x,y] = 1
      hosi.append([x,y])
  
    for a in hosi:
      dx,dy = a[0] - kijun[0], a[1] - kijun[1]
      for b in seiza:
        if not (b[0] + dx, b[1] + dy) in point:
          break
      else:
        print(dx,dy)
        break
main()
from itertools import combinations_with_replacement as h_func
n, a, b = map(int, input().split())
if a > b:
    print(0)
    exit()
if n == 1:
    if a == b:
        print(1)
    else:
        print(0)
    exit()
x = [i for i in range(a, b+1)]
ans = set()
for p in h_func(x, n-2):
    ans.add(sum(p))
print(len(ans))


### FIXED CODE ###

n, a, b = map(int, input().split())
if a > b:
    print(0)
    exit()
if n == 1:
    if a == b:
        print(1)
    else:
        print(0)
    exit()
print((n-1)*b+a-(n-1)*a-b+1)
#include<bits/stdc++.h>
using namespace std;

int main()
{
    int l,r,c;
    cin>>l>>r;

    c=((l*(l+1))%2019);
    cout<<c<<endl;
    return 0;
}

### FIXED CODE ###

def main():
    a,b = map(int,input().split())
    if a-b+1>=2019:
        print(0)
    else:
        mini = 2020
        for i in range(a,b+1):
            for j in range(a,i):
                joke = i*j%2019
                if joke<mini:
                    mini = joke
                    if mini == 0:
                        print(0)
                        return 0
        print(mini)
main()
S=int(input())
if S[0]=S[1] or S[1]=S[2] or S[2]=S[3]:
  print("Bad")
else:
  print("Good")
  

### FIXED CODE ###

S=input()
count=1
for i in range(3):
    if S[i] == S[i+1]:
        print('Bad')
        break
else:
    print('Good')
n=int(input())
l=[input() for j in range(n)]
for i in range(n)[:-1]:
	f=l[i]
	for s in range(n)[i1:]:
    	if s != i:
			a=[f[k] for k in range(10)]
            g=l[s]
            b=[g[c] for c in range(10)]
            q +=1 if sorted(a)==sorted(b)
print(q)

### FIXED CODE ###

from collections import Counter as co
from operator import mul
from functools import reduce

def combinations_count(n, r):
  r = min(r, n - r)
  numer = reduce(mul, range(n, n - r, -1), 1)
  denom = reduce(mul, range(1, r + 1), 1)
  return numer//denom


n=int(input())
a=0
l=[''.join(list(map(str,sum(sorted(list(map(list,co(input()).items()))),[])))) for i in range(n)]
for d,s in co(l).items():
  if s>=2:a+=combinations_count(s, 2)
print(a)
s,t=map(input().split())
a,b=map(int,input().split())
c=int()

if s==c:
  print("{}""{}".format(a-1,b))
else:
  print("{}""{}".format(a,b-1))

### FIXED CODE ###

s,t=input().split()
a,b=map(int,input().split())
c=input()
d=" "
if s==c:
  print("{}""{}""{}".format(a-1,d,b))
else:
  print("{}""{}""{}".format(a,d,b-1))
N=int(input())
H=list(map(int,input().split()))
dp=[0]*N
def cost(n):
    if dp[n-1]:
        return dp[n-1]
    elif n==1:
        return 0
    elif n==2:
        return abs(H[1]-H[0])
    else:
        ans=min(cost(n-2)+abs(H[n-1]-H[n-3]),cost(n-1)+abs(H[n-1]-H[n-2]))
    dp[n-1]=ans
    return ans

print(cost(N))

### FIXED CODE ###

N=int(input())
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-2]+abs(H[i]-H[i-2]),dp[i-1]+abs(H[i]-H[i-1]))

print(dp[N-1])
abck=list(map(int,input().split()))
a=abck[0]
b=abck[1]
c=abck[2]
k=abck[3]

list=[]+[1]*a+[0]*b+[-1]*c
ans=0
for i in range(k):
    ans+=list[i]

print(ans)


### FIXED CODE ###

abck=list(map(int,input().split()))
a=abck[0]
b=abck[1]
c=abck[2]
k=abck[3]

if a>=k:
    print(k)
elif a<k:
    if a+b>=k:
        print(a)
    else:
        print(a-(k-a-b))
n, m = map(int, input().split())

lis = sorted(list(map(int, input().split())))

query = []
for i in range(m):
    b, c = map(int, input().split())
    query.append([c, b])

query.sort(reverse = 1)

i = 0
for j in query:
    for k in range(j[-1]):
        if lis[i] < j[0]:
            lis[i] = j[0]
            i += 1 
        else:
            break

print(sum(lis))

### FIXED CODE ###

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

lis = sorted(list(map(int, input().split())))

query = []
for i in range(m):
    b, c = map(int, input().split())
    query.append([c, b])

query.sort(reverse = 1)

i = 0
for j in query:
    for k in range(j[-1]):
        if i < n:
            if lis[i] < j[0]:
                lis[i] = j[0]
                i += 1 
            else:
                break
        else:
            break
        
print(sum(lis))
inf = 2019
L, R = map(int, input().split())
ans = 2018

for i in range(L, R):
    for j in range(i + 1, R + 1):
        tmp = int((i%inf * j%inf) % inf)
        ans = min(ans, tmp)
    if ans == 0:
        break

print(ans)

### FIXED CODE ###

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

tmp1 = N * A
ans = min(tmp1, B)
print(ans)
n=int(input())
T=[]
for _ in range(n):
    t = int(input())
    T.append(t)

def gcd(a,b):
    while b:
        a,b=b,a%b
    return a

def lcm(a,b):
    return a*b//gcd(a,b)

for i in range(n-1):
    ans=lcm(T[i], T[i+1])

print(ans)

### FIXED CODE ###

n=int(input())
T=[]
for _ in range(n):
    t = int(input())
    T.append(t)

def gcd(a,b):
    while b:
        a,b=b,a%b
    return a

def lcm(a,b):
    return a*b//gcd(a,b)

ans = T[0]
for i in range(1,n):
    ans=lcm(ans, T[i])

print(ans)
import queue

h,w=map(int,input().split())

m=[input() for i in range(w)]

q=queue.Queue()

cnt=[[1000000 for i in range(h)]for j in range(w)]


if m[0][0]=="#":
    cnt[0][0]=1
else:
    cnt[0][0]=0

for y in range(w):
    for x in range(h):
        if x!=0:
            if m[y][x-1]=="." and m[y][x]=="#":
                cnt[y][x]=min(cnt[y][x],cnt[y][x-1]+1)
            else:
                cnt[y][x]=min(cnt[y][x],cnt[y][x-1])
        if y!=0:
            if m[y-1][x]=="." and m[y][x]=="#":
                cnt[y][x]=min(cnt[y][x],cnt[y-1][x]+1)
            else:
                cnt[y][x]=min(cnt[y][x],cnt[y-1][x])


print(cnt[w-1][h-1])


### FIXED CODE ###

h,w=map(int,input().split())

m=[input() for i in range(h)]


cnt=[[1000000 for i in range(w)] for j in range(h)]

if m[0][0]=="#":
    cnt[0][0]=1
else:
    cnt[0][0]=0

for y in range(h):
    for x in range(w):
        if x>0:
            if m[y][x-1]=="." and m[y][x]=="#":
                cnt[y][x]=min(cnt[y][x],cnt[y][x-1]+1)
            else:
                cnt[y][x]=min(cnt[y][x],cnt[y][x-1])
        if y>0:
            if m[y-1][x]=="." and m[y][x]=="#":
                cnt[y][x]=min(cnt[y][x],cnt[y-1][x]+1)
            else:
                cnt[y][x]=min(cnt[y][x],cnt[y-1][x])


print(cnt[h-1][w-1])
s = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
S = input()
print(7 - index(S))

### FIXED CODE ###

s = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
S = input()
print(7 - s.index(S))
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
sum=0
for i in range(n-1):
  if (a[i+1]-a[i])==1:
    sum+=c[a[i]-1]
print(sum(b)+sum)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
s=0
for i in range(n-1):
  if (a[i+1]-a[i])==1:
    s+=c[a[i]-1]
print(s+sum(b))
c=[0]*100010
N=int(input())
for _ in range(N):
  a,b=map(int,input().split())
  c[a] += 1
  c[b+1] -= 1
for i in range(len(c)-1):
  c[i+1] += c[i]
print(sum(c))

### FIXED CODE ###

print('Yes' if '9' in input() else 'No')
N = int(input())
S = list(input())

a = 0
b = 0
c = 0
d = 0

a = [i for i, x in enumerate(S) if x == '('][0]
b = [i for i, x in enumerate(S) if x == ')'][-1]

light_a = S[:b+1].count('(')
light_b = S[:b+1].count(')')
left_a = S[a:].count('(')
legt_b = S[a:].count(')')

#print(light_a, light_b, left_a, legt_b)
c = max(0, light_b - light_a)
d = max(0, left_a - legt_b)
#print(c, d)

#print(a, b)
S = '('*c + ''.join(S) + ')'*d
print(S)


### FIXED CODE ###

#%%
N = int(input())
S = list(input())

T = S.copy()

flag = False

#print(S)


for i in range(N):
    flag = False
    i = 0
    while True:
        if i > len(S) - 1:
            break
        if S[i] == '(':
            tmp = i
            flag = True
        if flag and S[i] == ')':
            S.pop(i)
            S.pop(tmp)
            flag = False
        i += 1

#print(S)
#print(T)

a = S.count('(')
b = S.count(')')

ans = '('*b + ''.join(T) + ')'*a
print(ans)
import math
a,b,x=map(int,input().split())
x_2d = x/a
print(x_2d)
if x/a > (a*b)/2:
    print(90-math.degrees(math.atan(a/(2*b-2*x/(a*a)))))
else:
    print(math.degrees(math.atan(b/(2*x/(a*b)))))

### FIXED CODE ###

import math
a,b,x=map(int,input().split())
x_2d = x/a
if a*a*b == x:
    print(0)
    exit()
if x/a > (a*b)/2:
    print(90-math.degrees(math.atan(a/(2*b-2*x/(a*a)))))
else:
    print(math.degrees(math.atan(b/(2*x/(a*b)))))
import sys
sys.setrecursionlimit(10**9)

n=int(input())
# n=100000
tree=[set() for i in range(n)]
edges=[tuple(map(int,input().split())) for i in range(n-1)]
edge_color={}
for a,b in edges:
    a-=1
    b-=1
    tree[a].add(b)
    tree[b].add(a)
k = 0
for i in range(n):
    k = max(k,len(tree[i]))

for e in edges:
    edge_color[e] = 0

def colorize(u,v,c):
    edge_color[(min(u,v),max(u,v))] = c
    cc = c+1
    if cc > k:
        cc = 1
    for x in tree[u]:
        if edge_color[(min(x,u),max(x,u))] == 0:
            colorize(x,u,cc)
            cc += 1
            if cc > k:
                cc = 1

colorize(0,1,1)
print(k)
for e in edges:
    print(edge_color[e])

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)

n=int(input())
# n=100000
tree=[set() for i in range(n)]
edges=[tuple(map(int,input().split())) for i in range(n-1)]
edge_color={}
for a,b in edges:
    a-=1
    b-=1
    tree[a].add(b)
    tree[b].add(a)
k = 0
for i in range(n):
    k = max(k,len(tree[i]))

for a,b in edges:
    edge_color[(a-1,b-1)] = 0

def colorize(u,v,c,init=False):
    if not init:
        edge_color[(min(u,v),max(u,v))] = c
    cc = c+1
    if cc > k:
        cc = 1
    for x in tree[u]:
        if edge_color[(min(x,u),max(x,u))] == 0:
            colorize(x,u,cc)
            cc += 1
            if cc > k:
                cc = 1

colorize(0,1,1,True)
print(k)
for a,b in edges:
    print(edge_color[(a-1,b-1)])
import numpy as np
def niku(level, num):
	maisu = 2**(level+2)-3
	if(num <= level):
		return 0
	elif(num < (maisu+1)/2):
		return niku(level-1, num-1)
	elif(num == (maisu+1)/2):
		return 2**(level+1-1)-1+1
	else:
		return 2**(level+1-1)-1+1+niku(level-1, num-((maisu+1)/2))

def main():
	
	buf = input().split()
	n = int(buf[0])
	x = int(buf[1])
	print(niku(n, x))
		
main()

### FIXED CODE ###

import numpy as np
def niku(level, num):
	maisu = 2**(level+2)-3
	if(num <= level):
		return 0
	elif(level == 0):
		return 1
	elif(num < (maisu+1)/2):
		return niku(level-1, num-1)
	elif(num == (maisu+1)/2):
		return 2**(level+1-1)-1+1
	else:
		return 2**(level+1-1)-1+1+niku(level-1, num-((maisu+1)/2))

def main():
	
	buf = input().split()
	n = int(buf[0])
	x = int(buf[1])
	print(niku(n, x))
		
main()
a, b, c = map(int, input().split())
print(a[0] + b[0] + c[0])


### FIXED CODE ###

a, b, c = map(str, input().split())
print(a[0] + b[0] + c[0])
n=int(input())
a=[]
for i in range(n):
       a〔int(input())〕=i+ 1
print(a)

### FIXED CODE ###

n=int(input())
A=list(map(int,input().split()))
ans=[0]*n
for i in range(n):
  ans[A[i]-1]=i+1
print(*ans)
N = int(input())
A = list(map(int,input().split()))
# def helper(A):
#     v = min(A)
#     ans = set()
#     for a in A:
#         if a%v!=0:
#             ans.add(a%v)
#     ans.add(v)
#     return ans

# while len(A)>1:
#     A = helper(A)
# print(min(A))
def gcd(x,y):
    if y==0: return x
    return gcd(y,x%y)
ans = A[0]
for a in A:
    ans = gcd(ans,i)
print(ans)

### FIXED CODE ###

N = int(input())
A = set(map(int,input().split()))
def helper(A):
    v = min(A)
    ans = set()
    for a in A:
        if a%v!=0:
            ans.add(a%v)
    ans.add(v)
    return ans

while len(A)>1:
    A = helper(A)
print(min(A))
from collections import Counter, defaultdict
import sys
sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline
from math import factorial
import heapq, bisect
import math
import itertools


import queue
from collections import deque


def main():
    s = list(input())
    t = list('AKIHABARA')

    ind = 0
    for i in range(len(s)):
        if s[i] != t[ind]:
            while s[i] != t[ind]:
                if ind >= len(t) - 1:
                    break
                ind += 1
            if s[i] != t[ind]:
                print('NO')
                sys.exit()
        ind += 1
    print('YES')






if __name__ == '__main__':
    main()
    # test()



### FIXED CODE ###

from collections import Counter, defaultdict
import sys
sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline
from math import factorial
import heapq, bisect
import math
import itertools


import queue
from collections import deque


def main():
    s = input()

    aa = ['AKIHABARA', 'AKIHABAR', 'AKIHABRA', 'AKIHABR', 'AKIHBARA', 'AKIHBAR', 'AKIHBRA', 'AKIHBR']
    bb = ['KIHABARA', 'KIHABAR', 'KIHABRA', 'KIHABR', 'KIHBARA', 'KIHBAR', 'KIHBRA', 'KIHBR']

    if s in aa or s in bb:
        print('YES')
    else:
        print('NO')





if __name__ == '__main__':
    main()
    # test()
A,B-map(int,inout().split())
A=A-1
B=B-1
print(A*B)

### FIXED CODE ###

A,B=map(int,input().split())
A=A-1
B=B-1
print(A*B)
n = int(input())
a = []
d = []
for _ in range(n):
    a.append(list(map(int,input().split())))
    d.append([0,0,0])
d[0]=a[0]
for i in range(1,n):
    for j in range(3):
        d[i][j]=max(d[i-1][(j+1)%3],d[i-1][(j+2)%3])+a[i][j]
print(max(d[n-1]))


### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
b = [0]*n
b[1] = abs(a[1]-a[0])
for i in range(2,n):
    b[i]=min(b[i-2]+abs(a[i-2]-a[i]), b[i-1]+abs(a[i-1]-a[i]))
print(b[n-1])
import bisect
n = int(input())
c = [int(input()) for i in range(n)]
dp = [1 for i in range(n)]
dp2 = [-1 for i in range(n)]
memo = {}
ans = 0

def count(s):
  memo = {}
  res = 1
  for i in range(len(s)):
    if s[i] not in memo:
      memo[s[i]] = 1
    else:
      memo[s[i]] += 1
  for i in memo:
    res = res*((memo[i]*(memo[i]+1))//2)
  return res


dp2[c[0]] = 0
#print("dp",dp)
#print("dp2",dp2)
     
for i in range(1,n):
  
  if c[i] != c[i-1]:
    if dp2[c[i]] == -1:
      dp2[c[i]] = i
    else:
      dp[c[i]] = count(c[dp2[c[i]]:i])*dp[c[i]]
      ans += dp[c[i]]
      dp2[c[i]] = i

 # print(i,"dp",dp)
  #print(i,"dp2",dp2)
  #print(ans)   
#    for j in range(9):
#      ans += len()-1
#      bisect.bisect_left(li[i],)
print(ans)

### FIXED CODE ###

n = int(input())
cc = [int(input()) for i in range(n)]
c = [cc[0]]
for i in range(1,n):
  if cc[i] != cc[i-1]:
    c.append(cc[i])

n = len(c)
dp = [0 for i in range(n)]
pos_dp = [-1 for i in range(2*10**5+1)]

dp[0] = 1
pos_dp[c[0]] = 0
     
for i in range(1,n):
  if pos_dp[c[i]]!=-1:
    dp[i] = (dp[i-1] + dp[pos_dp[c[i]]])%1000000007
  else:
    dp[i] = dp[i-1] 
  pos_dp[c[i]] = i

print(dp[n-1])
import sys,math
N,M = map(int,input().split())
a = []
cnt = 0
ans = 1
fi = []
fi.append(1)
fi.append(1)
fi.append(1)
for i in range(3,10*5+2):
    tmp = fi[i-1]+fi[i-2]
    fi.append(tmp)
for i in range(M):
    a.append(int(input()))
for i in range(N+1):
    if i in a:
        if cnt == 0:
            print(0)
            sys.exit()
        else:
            ans *= fi[cnt]
            cnt = 0
    else:
        cnt += 1
ans *= fi[cnt]

print(ans % 1000000007)

### FIXED CODE ###

import sys,math
N,M = map(int,input().split())
a = [int(input()) for i in range(M)]
b = set(a)
dp = [0] * (N+1)
mod = 10**9+7
for i in range(N,-1,-1):
    if i in b:
        continue
    elif i == N or i == N-1:
        dp[i] = 1
    else:
        dp[i] = (dp[i+1] + dp[i+2])%mod
print(dp[0])
a,b=input().split

c=a*b

if c%2==0:
  print("Even")
 else:
  print("odd")


### FIXED CODE ###

a, b = map(int, input().split())
print("Even" if a*b % 2 == 0 else "Odd")