Harryxun/stf_run huggingface dataset:
a,b,c,d=map(int,input().split())
ans=0
if not a<k:
  print(k)
else:
  if not a+b<k:
    print(a)
  else:
    print(2*a+b-k)

### FIXED CODE ###

a,b,c,d=map(int,input().split())
ans=0
if not a<d:
  print(d)
else:
  if not a+b<d:
    print(a)
  else:
    print(2*a+b-d)
n = 6;
a = [input() for i in range(n)]

k = a[-1];
ans = "Yay!";

for i in range(n-1):
  #print("n-i-1: " + str(n-i-1));
  if k < a[n-i-1] - a[i]:
    ans = ":( ";
    break;

print ans;

### FIXED CODE ###

n = 6;
a = [input() for i in range(n)];
 
k = a[-1];
ans = "Yay!";
 
for i in range(n-1):
  for j in reversed(range(n-1)):
    if k < a[i] - a[j]:
      ans = ":( ";
      break;
print ans;
X = int(input())
num = [105, 104, 103, 102, 101, 100]

dp = [0 for _ in range(X+1)]
dp[0] = 1
f = 1

for i in range(X+1):
    for j in num:
        if i-j >= 0:
            if dp[i-j]:
                dp[i] = 1

for i in num:
    if not dp[X-i]:
        f = 0

print(f)

### FIXED CODE ###

X = int(input())
num = [105, 104, 103, 102, 101, 100]

dp = [0 for _ in range(X+1)]
dp[0] = 1
f = 1

for i in range(X+1):
    for j in num:
        if i-j >= 0:
            if dp[i-j]:
                dp[i] = 1

print(dp[X])
A, B = [int(v) for v in input().split(' ')]

def gcd(x, y):
    while y != 0:
        x, y = y, x % y
    return x

def cf(x1, x2):
    array = [1]
    for i in primes(gcd(x1, x2)):
        if x1 % i == 0 and x2 % i == 0:
            array.append(i)
    return array 

def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

cf_array = cf(A, B)

print(len(cf_array))
            


### FIXED CODE ###

A, B = [int(v) for v in input().split(' ')]

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2

    i = 3
    while i * i <= n:
        if n % i == 0:
            a.append(i)
            n //= i
        else:
            i += 2

    if n != 1:
        a.append(n)
    return a

a_fact = prime_factorize(A)
b_fact = prime_factorize(B)

print(len(set(a_fact) & set(b_fact)) + 1)
n,q=map(int,input().split())
s=list(str(input()))
l=[]
r=[]
ans=0
x=[]
for i in range(q):
  l1,r1=map(int,input().split())
  l.append(l1)
  r.append(r1)

for j in range(0,n):
  if s[j]=="A" and s[j+1]=="C":
    ans+=1
    x.append(ans)
  
for k in range(0,q):
  print(x[r[k]-1]-x[l[k]-1])
      
      
      
  
  
  
  


### FIXED CODE ###

n,q=map(int,input().split())
s=list(str(input()))
l=[]
r=[]
ans=0
x=[0]
for i in range(q):
  l1,r1=map(int,input().split())
  l.append(l1)
  r.append(r1)

for j in range(0,n-1):
  if s[j]=="A" and s[j+1]=="C":
    ans+=1
    x.append(ans)
  else:
    x.append(ans)

for k in range(0,q):
  print(x[r[k]-1]-x[l[k]-1])
# coding:utf-8

import sys
# from collections import Counter, defaultdict

INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


def main():
    n, q = LI()
    S = SI()

    B = [LS() for _ in range(q)]
    l, r = 0, n - 1
    ls, rs = '@', '@'
    cl, cr = 0, 0
    for t, d in B[::-1]:
        if d == 'L':
            if t == S[l]:
                cl = l + 1
                l += 1
                ls = t
            if rs == t:
                cr -= 1

        else:
            if t == S[r]:
                cr = n - r
                r -= 1
                rs = t
            if ls == t:
                cl -= 1

    return max(0, n - cl - cr)


print(main())


### FIXED CODE ###

# coding:utf-8

import sys

INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


def main():
    n, q = LI()
    S = SI()

    Q = [LS() for _ in range(q)]

    def left_out(i):
        if i < 0: return True
        if i >= n: return False
        for t, d in Q:
            if t != S[i]: continue
            if d == 'L':
                i -= 1
                if i < 0: return True
            else:
                i += 1
                if i >= n: return False

        return False

    def right_out(i):
        if i < 0: return False
        if i >= n: return True
        for t, d in Q:
            if t != S[i]: continue
            if d == 'L':
                i -= 1
                if i < 0: return False
            else:
                i += 1
                if i >= n: return True

        return False

    # 左へ落ちるロボット
    l_ok, l_ng = -1, n
    while abs(l_ok - l_ng) > 1:
        mid = (l_ok + l_ng) // 2
        if left_out(mid):
            l_ok = mid
        else:
            l_ng = mid

    # 右へ落ちるロボット
    r_ok, r_ng = n, -1
    while abs(r_ok - r_ng) > 1:
        mid = (r_ok + r_ng) // 2
        if right_out(mid):
            r_ok = mid
        else:
            r_ng = mid

    return max(0, r_ok - l_ok - 1)


print(main())
INFTY = 1 << 21
WHITE = 0
GRAY = 1
BLACK = 2
 
n = int(input())
M = [list(map(int, input().split())) for i in range(n)]
 
d = [INFTY for i in range(n)]
color = [WHITE for i in range(n)]
 
for i in range(n):
    u = int(input())
    k = int(input())
    for j in range(k):
        v = int(input())
        c = int(input())
        M[u][v] = c
        
def dijkstra():
    global M, d, color
    d[0] = 0
    color[0] = GRAY
    while(1):
        minv = INFTY
        u = -1
        for i in range(n):
            if (minv > d[i] and color[i] != BLACK):
                u = i
                minv = d[i]
        if (u == -1):
            break
        color[u] = BLACK
        for v in range(n):
            if (color[v] != BLACK and M[u][v] != INFTY):
                if (d[v] > d[u] + M[u][v]):
                    d[v] = d[u] + M[u][v]
                    color[v] = GRAY
    for i in range(n):
        print(str(i), (-1 if d[i] == INFTY else str(d[i])))
dijkstra()

### FIXED CODE ###

from sys import stdin

INFTY = 1 << 21
WHITE = 0
GRAY = 1
BLACK = 2

n = int(stdin.readline())
M = [[INFTY for i in range(n)] for j in range(n)]

for u in range(n):
    U = list(map(int, stdin.readline().split()[2:]))
    for j in range(0, len(U), 2):
        M[u][U[j]] = U[j+1]

d = [INFTY for i in range(n)]
color = [WHITE for i in range(n)]

def dijkstra():
    global n
    d[0] = 0
    color[0] = GRAY
    while(1):
        minv = INFTY
        u = -1
        for i in range(n):
            if (minv > d[i] and color[i] != BLACK):
                u = i
                minv = d[i]
        if (u == -1):
            break
        color[u] = BLACK
        for v in range(n):
            if (color[v] != BLACK and M[u][v] != INFTY):
                if(d[v] > d[u] + M[u][v]):
                    d[v] = d[u] + M[u][v]
                    color[v] = GRAY
    for i in range(
n):
        print(i, (-1 if d[i] == INFTY else d[i]))
dijkstra()
n = int(input())
if n%10==9 or n//10==9:
  print('Yes')
else;
print('No')

### FIXED CODE ###

n = int(input())
if n%10==9 or n//10==9:
  print('Yes')
else:
  print('No')
input();s=map(int,input().split());print('YNeos'[sum(s)-max(s)*2<1::2])

### FIXED CODE ###

input();*s,=map(int,input().split());print('YNeos'[sum(s)-max(s)*2<1::2])
s = input()
if s == 'SUN':
    return 7
if s == 'MON':
    return 1
if s == 'TUE':
    return 2
if s == 'WED':
    return 3
if s == 'THU':
    return 4
if s == 'FRI':
    return 5
if s == 'SAT':
    return 6

### FIXED CODE ###

s = input()
if s == 'SUN':
    print(7)
if s == 'MON':
    print(6)
if s == 'TUE':
    print(5)
if s == 'WED':
    print(4)
if s == 'THU':
    print(3)
if s == 'FRI':
    print(2)
if s == 'SAT':
    print(1)
import math

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

N, M = map(int, input().split())
S = input()
T = input()
L = lcm(N , M)
x = [""] * (L)
for i in range(N):
    idx = i * (L // N)
    # x[idx] = S[i]
    print(x[idx])
for i in range(M):
    idx = i * (L // M)
    if x[idx] != "" and x[idx] != T[i]:
        print(-1)
        exit()
print(L)


### FIXED CODE ###

import math

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

N, M = map(int, input().split())
S = input()
T = input()
L = lcm(N , M)
x = {}
for i in range(N):
    idx = i * (L // N)
    x[idx] = S[i]
for i in range(M):
    idx = i * (L // M)
    if idx in x and x[idx] != T[i]:
        print(-1)
        exit()
print(L)
from collections import Counter
N=int(input())
x=[0]*N
y=[0]*N
for i in range(N):
  x[i],y[i] = map(int, input().split())
a = []
for i in range(N):
  for j in range(i+1,N):
    a.append(str(x[j]-x[i])+'&'+str(y[j]-y[i]))
    
a=Counter(a)
common = a.most_common(1)[0][1]
print(N-common)

### FIXED CODE ###

import sys
from collections import Counter

N=int(input())
if N==1:
  print(1)
  sys.exit()
  
x=[0]*N
y=[0]*N
for i in range(N):
  x[i],y[i] = map(int, input().split())
a = []
for i in range(N):
  for j in range(N):
    if i==j:
      continue
    else:
      a.append(str(x[j]-x[i])+'&'+str(y[j]-y[i]))
    
a=Counter(a)
common = a.most_common(1)[0][1]
print(N-common)
import numpy as np

def dijkstra(graph,node_count,start_index):
    INF = 10**9+7
    node = [INF] * node_count
    conf = [0] * node_count
    root = [-1] * node_count

    node[start_index] = 0
    count = 0
    while sum(conf) < node_count:

        change = False

        min_node_dex = -1
        min_node_val = INF
        for i in range(node_count):
            if conf[i] == 0:
                if node[i] < min_node_val:
                    min_node_val = node[i]
                    min_node_dex = i
        conf[min_node_dex] = 1
        for i in range(node_count):
            if conf[i] == 0:
                if g[min_node_dex][i] > 0:
                    new_dist = node[min_node_dex] + g[min_node_dex][i]
                    if new_dist < node[i]:
                        node[i] = new_dist
                        root[i] = min_node_dex
                        change = True

        #print(node)
        #print(conf)
        #print(root)
        count += 1
        if not change:
            break
        #if count >= 10:
        #    break
    return root

n, m = map(int, input().split())
r = []
g = np.zeros((n,n),dtype=np.uint32)

for i in range(m):
    a, b = map(int, input().split())
    g[a-1][b-1] = 1
    g[b-1][a-1] = 1
    #r.append([a,b])

#c = dijkstra_heapq(g,n,0)
c = dijkstra(g,n,0)

#print(np.array(c) + 1)

ans = []
for i in range(1,n):
    if c[i] >= 0:
        ans.append(c[i]+1)
    else:
        print('No')
        exit()

print('Yes')
for i in range(len(ans)):
    print(ans[i])

#print(np.array(c)+1)


### FIXED CODE ###

import queue
n, m = map(int, input().split())
g = [[] for _ in range(n+1)]

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

#print(g)

root = [0] * n
count = 0
q = queue.Queue()
q.put(0)
root[0] = 1
count += 1
while not q.empty():
    p = q.get()
    for i in g[p+1]:
        if root[i-1] <= 0:
            q.put(i-1)
            root[i-1] = p + 1
            count += 1
            #print(p,i,count,root)
            if count >= n:
                break


if count < n:
    print('No')
    exit()
else:
    print('Yes')
    for i in range(1,n):
        print(root[i])
import math
n, k = map(int, input().split())

def calc(dise, k):
    return (1/2) ** math.ceil(math.log2(k/dise))

ans = 0

for i in range(n):
    if i+1 >= k:
        ans += 1/n
    else:
        ans += calc(i+1, k) / n
print(ans)


### FIXED CODE ###

import math
n, k = map(int, input().split())

def calc(dise, k):
    return (1/2) ** math.ceil(math.log2(k/dise))

ans = 0

for i in range(n):
    if i+1 >= k:
        ans += 1/n
    else:
        ans += calc(i+1, k) / n
print(ans)
N,K=map(int,input().split())
if K==1:
    print(0)
else:
    print(N-K

### FIXED CODE ###

N,K=map(int,input().split())
if K==1:
    print(0)
else:
    print(N-K)
N,K = map(int,input().split())
h = list(map(int,input().split()))

ans = 0
for i in h:
  if h >= K:
    ans += 1
print(ans)

### FIXED CODE ###

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

line = 0
bool1 = False
for i in range(N):
  if h[i] >= K:
    line = i
    bool1 = True
    break

if bool1:
  print(N-i)
else:
  print(0)
n = int(input())
w = []
for i in range(n):
    x, y = map(int, input().split())
    z.append(x + y)
    w.append(x - y)
z.sort()
w.sort()
print(max(z[-1]-z[0], w[-1]-w[0]))

### FIXED CODE ###

n = int(input())

z = []
w = []
for i in range(n):
    x, y = map(int, input().split())
    z.append(x + y)
    w.append(x - y)
z.sort()
w.sort()
print(max(z[-1]-z[0], w[-1]-w[0]))
# -*- coding: utf-8 -*-
 
n, k, q =map(int, input().split())
a = [int(input())-1 for i in range(q)]

p = [0]*n

for i in range(q):
  q[a[i]] += 1
  

for i in range(n):
  if p[n]>k-q:
    print("Yes")
  else:
    print("No")
  

### FIXED CODE ###

# -*- coding: utf-8 -*-
 
n, k, q =map(int, input().split())
a = [int(input()) for i in range(q)]

p = [0]*(n+1)

for i in range(q):
  p[a[i]] += 1
  

for i in range(1,n+1):
  if p[i]>q-k:
    print("Yes")
  else:
    print("No")
def solution(a):
    return max(a) - min(a)
 
def main():
    a = [int(i) for i in raw_input().strip().aplit()]
    print solution(a)

if __name__ == '__main__':
    main()

### FIXED CODE ###

def solution(a):
    return max(a) - min(a)
 
def main():
    a = [int(i) for i in raw_input().strip().split()]
    print solution(a)
 
if __name__ == '__main__':
    main()
N = int(input())
p = list(map(int,input().split()))

count = 0

for i in range(N):
    if p[i] == i+1:
        p[i], p[i+1] = p[i+1], p[i]
        count += 1
print(count)

### FIXED CODE ###

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

count = 0

for i in range(N-1):
    if p[i] == i+1:
        p[i], p[i+1] = p[i+1], p[i]
        count += 1

i = N-1
if p[i] == i+1:
    p[i], p[i-1] = p[i-1], p[i]
    count += 1
        
print(count)
# coding: utf-8
# Here your code !
M, N = list(map(int, input().split()))
q = int(input())

Map = []
for i in range(M):
    Map.append(input)

def get_slide_sum(Map, kw):
    l = []
    for r in range(M):
        tmp = []
        for c in range(N):
            ll = 0 if c == 0 else tmp[c-1]
            ul = 0 if r == 0 or c == 0 else l[r-1][c-1]
            ur = 0 if r == 0 else l[r-1][c]
            count = ll + ur - ul
            if Map[r][c] == kw:
                count+=1
            tmp.append(count)
        l.append(tmp)
    return l

J = get_slide_sum(Map, 'J')
O = get_slide_sum(Map, 'O')
I = get_slide_sum(Map, 'I')

def get_sum(inp,L):
    a, b, c, d = list(map(int, inp.split()))
    ll = 0 if a == 1 else L[a-2][d-1]
    ul = 0 if a == 1 or b == 1 else L[a-2][b-2]
    ur = 0 if b == 1 else L[c-1][b-2]
    return L[c-1][d-1] - ll - ur + ul

for i in range(q):
    inp = input()
    print(get_sum(inp, J), get_sum(inp, O), get_sum(inp, I))

### FIXED CODE ###

# coding: utf-8
M, N = list(map(int, input().split()))
q = int(input())

Map = []
for i in range(M):
    Map.append(input())

def get_slide_sum(Map, kw):
    l = []
    for r in range(M):
        tmp = []
        for c in range(N):
            ll = 0 if c == 0 else tmp[c-1]
            ul = 0 if r == 0 or c == 0 else l[r-1][c-1]
            ur = 0 if r == 0 else l[r-1][c]
            count = ll + ur - ul
            if Map[r][c] == kw:
                count+=1
            tmp.append(count)
        l.append(tmp)
    return l

J = get_slide_sum(Map, 'J')
O = get_slide_sum(Map, 'O')
I = get_slide_sum(Map, 'I')

def get_sum(inp,L):
    a, b, c, d = list(map(int, inp.split()))
    ll = 0 if a == 1 else L[a-2][d-1]
    ul = 0 if a == 1 or b == 1 else L[a-2][b-2]
    ur = 0 if b == 1 else L[c-1][b-2]
    return L[c-1][d-1] - ll - ur + ul

for i in range(q):
    inp = input()
    print(get_sum(inp, J), get_sum(inp, O), get_sum(inp, I))
n=int(input())
H=[int(i) for i in input().split()]
H.append(0)
import math
dp=[math.inf for i in range(n+2)]
dp[0]=0

for i in range(n-1):
    dp[i+1]=min(dp[i+1],dp[i]+abs(H[i+1]-H[i]))
    dp[i+2]=min(dp[i+2],dp[i]+abs(H[i+2]-H[i]))

print(dp[n-1])

### FIXED CODE ###

n=int(input())
H=[int(i) for i in input().split()]
H.append(0)
import math
dp=[1e10 for i in range(n+2)]
dp[0]=0

for i in range(n-1):
    dp[i+1]=min(dp[i+1],dp[i]+abs(H[i+1]-H[i]))
    dp[i+2]=min(dp[i+2],dp[i]+abs(H[i+2]-H[i]))

print(dp[n-1])
max_fact = 5 * 10**5
mod = 10**9 + 7

f = [1] * (max_fact + 1)
for idx in range(2, max_fact + 1):
    f[idx] = f[idx - 1] * idx
    f[idx] %= mod
fi = [pow(f[-1], mod - 2, mod)]
for idx in range(max_fact, 0, -1):
    fi += [fi[-1] * idx % mod]
fi = fi[::-1]

def factorial(self, n):
    return f[n]

def factorial_inverse(self, n):
    return fi[n]

def combination(self, n, r):
    return f[n] * fi[r] * fi[n - r] % mod

def permutation(self, n, r):
    return f[n] * fi[n - r] % mod

def homogeneous_product(self, n, r):
    return f[n + r - 1] * fi[r] * fi[n - 1] % mod


comb = combination
perm = permutation

N, M = [int(_) for _ in input().split()]
ans = 0
for p in range(N + 1):
    ans += (-1)**p * comb(N, p) * perm(M - p, N - p)
    ans %= mod
ans *= perm(M, N)
ans %= mod
print(ans)


### FIXED CODE ###

class Factorial:
    def __init__(self, max_fact, mod):
        #mod should be prime number
        #using homogeneous_product(n,r), max_fact ≧ max(n+r-1)
        f = [1] * (max_fact + 1)
        for idx in range(2, max_fact + 1):
            f[idx] = f[idx - 1] * idx
            f[idx] %= mod
        fi = [pow(f[-1], mod - 2, mod)]
        for idx in range(max_fact, 0, -1):
            fi += [fi[-1] * idx % mod]
        fi = fi[::-1]
        self.mod = mod
        self.f = f
        self.fi = fi

    def factorial(self, n):
        return self.f[n]

    def factorial_inverse(self, n):
        return self.fi[n]

    def combination(self, n, r):
        f = self.f
        fi = self.fi
        return f[n] * fi[r] * fi[n - r] % self.mod

    def permutation(self, n, r):
        return self.f[n] * self.fi[n - r] % self.mod

    def homogeneous_product(self, n, r):
        f = self.f
        fi = self.fi
        return f[n + r - 1] * fi[r] * fi[n - 1] % self.mod


max_fact = 5 * 10**5
mod = 10**9 + 7
fact_instance = Factorial(max_fact, mod)
comb = fact_instance.combination
perm = fact_instance.permutation

N, M = [int(_) for _ in input().split()]
ans = 0
for p in range(N + 1):
    ans += (-1)**p * comb(N, p) * perm(M - p, N - p)
    ans %= mod
ans *= perm(M, N)
ans %= mod
print(ans)
import math


def isPrime(n):
    if n == 2:
        return True
    if n % 2 == 0:
        return False

        # nの平方根まで計算する
    m = math.floor(math.sqrt(n)) + 1
    for p in range(3, m, 2):
        if n % p == 0:
            return False
    return True


N = int(input())
if N == 1:
    print(0)
elif isPrime(N):
    print(1)
else:
    count = 0
    for i in range(2, N//2):
        if not isPrime(i):
            continue
        if isPrime(N) and i > N:
            break
        for j in range(1, 10):
            if N % i**j == 0:
                N = N / i**j
                count += 1
                if N == 1 or N % i != 0:
                    break
print(count)


### FIXED CODE ###

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if not arr:
        arr.append([n, 1])

    return arr


N = int(input())
p = factorization(N)
count = 0
for x in p:
    if N == 1:
        break
    for j in range(1, x[1] + 1):
        if N % (x[0] ** j) == 0:
            N /= x[0] ** j
            count += 1
        else:
            break
print(count)
import math
def conbination(x,y):
  return math.factorial(x) // (math.factorial(x-y) * math.factorial(y))
 
n, m = map(int, input().split())
a = []
for i in range(m):
  a.append(int(input()))

flag = 0
ans = 0
 
for i in range(m-1):
  if a[i+1] - a[i] == 1:
    ans = 0
    flag = 1
    break
    
if flag == 0:
  for i in range(n-2*m): #i:２段のぼる回数
    if i>=m
    ans += conbination(n-2*m-1, i-m) * (conbination(n-m, m) 
      
print(ans%(10**9+7)) 

### FIXED CODE ###

n, m = map(int, input().split())
a = []
for i in range(m):
  a.append(int(input()))
ans = 0
flag = 0
a = set(a)

#フィボナッチ数列の初期値を調節
dp = [0] * (n+1)
dp[0] = 1
if 1 in a:
  dp[1] = 0
else:
  dp[1] = 1
  
for i in range(2, n+1):
  if dp[i-2] == 0 and dp[i-1] == 0:
    ans = 0
    flag = 1
    break
  elif i in a:
    continue
  else:
    dp[i] = dp[i-1] + dp[i-2]
if flag == 0:
  ans = dp[n]
print(ans%(10**9+7))
N=int(input())
Ai=list(map(int,input().split()))

# ans=[]
ans=[]*N

# for i in range(1,N+1):
    # a=Ai.index(i)+1
    # ans.append(str(a))
for i in range (N):
    ans[Ai[i]-1]=str(i+1)

print(' '.join(ans))


### FIXED CODE ###

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

# ans=[]
ans=[0]*N

# for i in range(1,N+1):
    # a=Ai.index(i)+1
    # ans.append(str(a))
for i in range (N):
    ans[Ai[i]-1]=str(i+1)

print(' '.join(ans))
N, M, K = map(int, input().split())
A_list = list(map(int, input().split()))
B_list = list(map(int, input().split()))


f = open('b20.txt')
data = f.readlines()
data = [d.replace("\n", "").split(" ") for d in data]
N, M, K = map(int, data[0])
A_list = list(map(int, data[1]))
B_list = list(map(int, data[2]))

A_list.insert(0, 0)
B_list.insert(0, 0)
B_cumsum = np.cumsum(B_list)

time = B_cumsum[-1]
ans, j = 0, M

B_list[j]
for i in range(N+1):
    if (time > K):
        break
    while (j > 0 and time > K):
        time -= B_list[j]
        j -= 1
    
    ans = max(ans, i+j)
    time += A_list[i]

print(ans)

### FIXED CODE ###


import sys
import numpy as np
input = sys.stdin.readline

N, M, K = map(int, input().split())
A_list = list(map(int, input().split()))
B_list = list(map(int, input().split()))


A_list.insert(0, 0)
B_list.insert(0, 0)
A_cumsum = np.cumsum(A_list)
B_cumsum = np.cumsum(B_list)

time = B_cumsum[-1]
ans, j = 0, M



for i in range(N+1):
    if A_cumsum[i] > K:
        break
    while B_cumsum[j] > K - A_cumsum[i]:
        j -= 1
    ans = max(ans, i+j)
print(ans)
n=int(input())
h=list(map(int,input().split()))
if len(list(set(h)))==3:
  print("Three")
else:
  print("Four")

### FIXED CODE ###

n=int(input())
h=list(input().split())
if len(list(set(h)))==3:
  print("Three")
else:
  print("Four")
N, *d = map(int, open(0).read().split())
print(sum(d)-max(s)/2)

### FIXED CODE ###

N, *d = map(int, open(0).read().split())
print(int(sum(d)-max(d)/2))
n, k = map(int, input().split())
p = list(map(int, input().split()))

max_x = 0
idx = 0
x = 0

for i in range(n-k+1):
    x += p[i+k] - p[i]
    if max_x < x:
        max_x = x
        idx = i

ans = (sum(p[i:i+k]) + k) / 2
print(ans)

### FIXED CODE ###

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

max_x = 0
idx = 0
x = 0

if n == k:
    print((sum(p) + k) / 2)
    exit()

for i in range(n-k):
    x += p[i+k] - p[i]
    if max_x < x:
        max_x = x
        idx = i+1

ans = (sum(p[idx:idx+k]) + k) / 2
print(ans)
data=[]
for i in range(1,30001):
    if i%2==0 or i%3==0:
        data.append(i)
k=int(input())
if k==3:
    print(*[2,5,63])
elif k==4:
    print(*[2,5,20,63])
elif k==5:
    print(*[2,5,20,63,6])
ans=data[:k]
sm=sum(ans)
if sm%6==2:
    ans[4]=30000
elif sm%6==3:
    ans[5]=30000
elif sm%6==5:
    ans[5]=29998
print(*ans)

### FIXED CODE ###

data=[]
for i in range(1,30001):
    if i%2==0 or i%3==0:
        data.append(i)
k=int(input())
if k==3:
    print(*[2,5,63])
elif k==4:
    print(*[2,5,20,63])
elif k==5:
    print(*[2,5,20,63,30])
else:
    ans=data[:k]
    sm=sum(ans)
    if sm%6==2:
        ans[4]=30000
    elif sm%6==3:
        ans[5]=30000
    elif sm%6==5:
        ans[5]=29998
    print(*ans)