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

def main():
    N = input()
    L = [int(i) for i in input().split()]

    sL = sorted(L)

    ans = []
    
    sL = sorted(L)
    for num in sL:
        print(L.index(num) + 1, end=" ")

if __name__ == "__main__":
    main()

### FIXED CODE ###

def main():
    N = input()
    L = [int(i) for i in input().split()]
    
    siL = sorted(range(len(L)), key=lambda k: L[k])
    for i in siL:
        print(i + 1, end=" ")

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

from numba import njit
from numpy import int32,zeros,arange
@njit('i4(i4[:])')
def solve(s):
    a=0
    d=zeros(2019,int32)
    for i in s:
        p=zeros(2019,int32)
        p[(arange(2019)*10+i)%2019]+=d[arange(2019)]
        d=p
        d[i]+=1
        a+=d[0]
    return a
print(solve(int32([*input()])))

### FIXED CODE ###

a,*d=[0]*2020
for i in map(int,input()):
  p=[0]*2019
  for j in range(2019):p[(j*10+i)%2019]+=d[j]
  d=p
  d[i]+=1
  a+=d[0]
print(a)
### BUGGY CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	C
# CreatedDate:  2020-04-26 22:14:32 +0900
# LastModified: 2020-04-26 22:16:54 +0900
#


import os
import sys


def main():
    n=int(input())
    s = []
    count=0
    for i in range(n):
        chara = input()
        if not chara in s:
            s.append(chara)
            count+=1
    
    print(count)

if __name__ == "__main__":
    main()


### FIXED CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	C_fix
# CreatedDate:  2020-06-27 13:59:01 +0900
# LastModified: 2020-06-27 14:04:38 +0900
#


import os
import sys
# import numpy as np
# import pandas as pd


def main():
    n = int(input())
    s = []
    for i in range(n):
        s.append(input())
    s = list(set(s))
    print(len(s))
        


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

def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1

n,m = map(int, input().split())
  
if m % n == 0:
  print(m//n)
  exit()
  
elif is_prime(m):
  print(1)
  
else:
  i = 1
  ans = 0
  while i  <= m // n:
    tmp = m - i * n
    if tmp % i == 0 and ans < i:
      ans = i
    i += 1

  print(ans)

### FIXED CODE ###

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

ans = 1

for i in range(1, int(m ** 0.5)+1):
  if m % i == 0:
    if i >= n:
      ans = max(ans, m // i)
    elif m // i >= n:
      ans = max(ans, i)
      
      
print(ans)
### BUGGY CODE ###

a = str(raw_input())
b = str(raw_input())
c = str(raw_input())
s = a[0]
a = a[1:]
while True:
    if s == 'a':
        if len(a) == 1:
            print 'a'
            break
        s = a[0]
        a = a[1:]
    elif s == 'b':
        if len(b) == 1:
            print 'b'
            break
        s = b[0]
        b = b[1:]
    elif s == 'c':
        if len(c) == 1:
            print 'c'
            break
        s = c[0]
        c = c[1:]

### FIXED CODE ###

a = int(raw_input())
b = int(raw_input())
h = int(raw_input())
print "{}".format(int((a+b)*h/2))
### BUGGY CODE ###

from collections import deque

H,W = map(int,input().split())
C = list(map(int,input().split()))
D = list(map(int,input().split()))

S = ["##" + input() + "##" for _ in range(H)]
for i in range(2):
    S.insert(0,"#"*(W+4))
    S.append("#"*(W+4))

INF = float("inf")
cost = [[INF for _ in range(W+4)] for _ in range(H+4)]
cost0 = deque()
ans = -1

cost0.append((C[0]+1, C[1]+1, 0))
cost[C[0]+1][C[1]+1] = 0

move = [(1,0), (0,1), (-1,0), (0,-1)]
warp = [(i, j) for i in range(-2, 3) for j in range(-2, 3) if (i, j) not in [(0, 0)]+move]

cost1 = deque()

while cost0:
    h,w,c = cost0.popleft()
    cost1.append((h,w,c))

    for i, j in move:
        dh = h+i
        dw = w+j
        if S[dh][dw] == "." and c < cost[dh][dw]:
            cost[dh][dw] = c
            cost0.appendleft((dh, dw, cost[dh][dw]))
    
    if len(cost0) == 0:
        while cost1:
            h, w, c = cost1.popleft()
            for i, j in warp:
                dh = h+i
                dw = w+j
                if S[dh][dw] == "." and c+1 < cost[dh][dw]:
                    cost[dh][dw] = c+1
                    cost0.append((dh,dw, cost[dh][dw]))
    
    if cost[D[0]+1][D[1]+1] != INF:
        ans = cost[D[0]+1][D[1]+1]

print(ans)

### FIXED CODE ###

from collections import deque

def solve():
    H,W = map(int,input().split())
    C = list(map(int,input().split()))
    D = list(map(int,input().split()))

    S = ["##" + input() + "##" for _ in range(H)]
    for i in range(2):
        S.insert(0,"#"*(W+4))
        S.append("#"*(W+4))

    INF = float("inf")
    cost = [[INF for _ in range(W+4)] for _ in range(H+4)]
    cost0 = deque()
    ans = -1

    cost0.append((C[0]+1, C[1]+1, 0))
    cost[C[0]+1][C[1]+1] = 0

    move = [(1,0), (0,1), (-1,0), (0,-1)]
    warp = [(i, j) for i in range(-2, 3) for j in range(-2, 3) if (i, j) not in [(0, 0)]+move]

    cost1 = deque()

    while cost0:
        h,w,c = cost0.popleft()
        cost1.append((h,w,c))

        for i, j in move:
            dh = h+i
            dw = w+j
            if S[dh][dw] == "." and c < cost[dh][dw]:
                cost[dh][dw] = c
                cost0.appendleft((dh, dw, cost[dh][dw]))
        
        if len(cost0) == 0:
            while cost1:
                h, w, c = cost1.popleft()
                for i, j in warp:
                    dh = h+i
                    dw = w+j
                    if S[dh][dw] == "." and c+1 < cost[dh][dw]:
                        cost[dh][dw] = c+1
                        cost0.append((dh,dw, cost[dh][dw]))
        
        if cost[D[0]+1][D[1]+1] != INF:
            ans = cost[D[0]+1][D[1]+1]

    print(ans)

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

H,N=map(int,input().split(' '))
Magics = [list(map(int,input().split(' '))) for i in range(N)]
dp=[float('inf')]*(H+1)
dp[0]=0
for i in range(H+1):
    for a,b in Magics:
        if i+a<=H:
            dp[i+a]=min(dp[i+a],dp[i]+b)
        else:
            dp[H]=min(dp[H],dp[i]+b)
print(dp[H])

### FIXED CODE ###

H,N=map(int,input().split(' '))
Magics = [list(map(int,input().split(' '))) for i in range(N)]
dp=[float('inf')]*(H+1)
dp[H]=0
for i in range(H,-1,-1):
    for a,b in Magics:
        if 0<=i-a<=H:
            dp[i-a]=min(dp[i-a],dp[i]+b)
        else:
            dp[0]=min(dp[0],dp[i]+b)
print(dp[0])
### BUGGY CODE ###

import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
import cmath as cma
import copy as cp
import sys
def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def barr(n): return [False for _ in range(n)]
sys.setrecursionlimit(10**7)
MOD = 10**9 + 7; EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf

s = sinput().split()
q = iinput()
cnt = 0
for i in range(q):
    try: t,f,c = sarr()
    except: cnt += 1; cnt %= 2; continue
    if cnt: #反転の状態
        if f == "1": s = s + [c]
        if f == "2": s = [c] + s
    else: #ノーマル状態
        if f == "1": s = [c] + s
        if f == "2": s = s + [c]
    #print(s)

s = "".join(s)
s = s[::-1] if cnt else s
print(s)



### FIXED CODE ###

import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
import cmath as cma
import copy as cp
import sys
def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def barr(n): return [False for _ in range(n)]
sys.setrecursionlimit(10**7)
MOD = 10**9 + 7; EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf

s = col.deque(sinput().split())
q = iinput()
cnt = 0
for i in range(q):
    try: t,f,c = sarr()
    except: cnt += 1; cnt %= 2; continue
    if cnt: #反転の状態
        if f == "1": s.append(c)
        if f == "2": s.appendleft(c)
    else: #ノーマル状態
        if f == "1": s.appendleft(c)
        if f == "2": s.append(c)
    #print(s)

s = "".join(s)
s = s[::-1] if cnt else s
print(s)
### BUGGY CODE ###

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

ans = 0
for i in range(1,N+1):
  for j in range(1,i+1):
    if P[j-1]<P[i-1]:
      break
  else:
    ans += 1

print(ans)

### FIXED CODE ###

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

ans = 0
min = max(P)
for i in range(1,N+1):
  if P[i-1]<min:
    min = P[i-1]
  if min>=P[i-1]:
    ans += 1

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

r,g,b,n=map(int,input().split())
ans=0
x=0
while x*r<=n:
    y=0
    while y*g<=n-x*r:
        aaa = (n-x*r-y*g) / b
        if aaa.is_integer():
            ans+=1
        y+=1
    x+=1
print(ans)

### FIXED CODE ###

r0,g0,b0,n=map(int,input().split())
ans=0
l=[r0,g0,b0]
l.sort(reverse=True)
r=l[0]
g=l[1]
b=l[2]
x=0
while x*r<=n:
    y=0
    if g==1:
        ans+=1+n-x*r
        x+=1
        continue
    if b==1:
        ans+=1+(n-x*r)//g
        x+=1
        continue
    while y*g<=n-x*r:
        if (n-x*r-y*g) % b == 0:
            ans+=1
        y+=1
    x+=1
print(ans)
### BUGGY CODE ###

from collections import deque
h,w=map(int,input().split())
a=[list(input()) for _ in range(h)]
field=[[False for i in range(w)] for j in range(h)]
 
q=deque()
 
for i in range(h):
    for j in range(w):
        if a[i][j]=='#':
            q.append((i,j))
            field[i][j]=True
 
dx=[1,0,-1,0]            
dy=[0,1,0,-1]
ans=0
 
while q:
    nq=deque()
    while True:
        y,x=q.popleft()    
        for i in range(4):
            ny=y+dy[i]
            nx=x+dx[i]
            if 0<=ny<h and 0<=nx<w and field[ny][nx]==False:
                field[ny][nx]=True
                nq.append((ny,nx))

        if not q:
            ans+=1
            q=nq
            break
print(ans-1)

### FIXED CODE ###

from collections import deque
h,w=map(int,input().split())
a=[list(input()) for _ in range(h)]
field=[[False for i in range(w)] for j in range(h)]
 
q=deque()
 
for i in range(h):
    for j in range(w):
        if a[i][j]=='#':
            q.append((i,j))
            field[i][j]=True
 
dx=[1,0,-1,0]            
dy=[0,1,0,-1]
ans=0
 
while q:
    nq=deque()
    while True:
        y,x=q.popleft()    
        for i in range(4):
            ny=y+dy[i]
            nx=x+dx[i]
            if 0<=ny<h and 0<=nx<w and field[ny][nx]==False:
                field[ny][nx]=True
                nq.append((ny,nx))

        if not q:
            ans+=1
            q=nq
            break
print(ans-1)
### BUGGY CODE ###

X = int(input())

#x^5-y^5=(x-y)(x^4+x^3y+x^2y^2+xy^3+y^4)

#for x in range(1, 121):
#  if ((x**5) - ((x-1)**5)) >= 1000000000:
#    print(x)

for a in range(1, 121):
  for b in range(-1000000, 120):
    if b**5 == a**5-X:
      print(a, b)
      break



### FIXED CODE ###

X = int(input())

#x^5-y^5=(x-y)(x^4+x^3y+x^2y^2+xy^3+y^4)

#for x in range(1, 121):
#  if ((x**5) - ((x-1)**5)) >= 1000000000:
#    print(x)

for a in range(0, 121):
  for b in reversed(range(-122, 120)):
    if b**5 == a**5-X:
      print(a, b)
      exit()
### BUGGY CODE ###

N,M=map(int,input().split())
a=[int(input()) for i in range(M)]
dp=[0]*(N+1)
dp[0]=1
dp[1]=0 if 1 in a else 1
mod=10**9+7

for i in range(2,N+1):
    if i in a:
        continue
    else:
        dp[i]=(dp[i-1]+dp[i-2])%mod

print(dp[N])

### FIXED CODE ###

N,M=map(int,input().split())
dp=[0]*(N+3)
dp[0]=1
a=[0]*(N+3)
for i in range(M):
    a[int(input())]=1
mod=10**9+7

for i in range(N+1):
    if a[i+1] != 1:
        dp[i+1]+=dp[i]
        dp[i+1]%=mod
    if a[i+2] != 1:
        dp[i+2]+=dp[i]
        dp[i+2]%=mod

print(dp[N])
### BUGGY CODE ###

import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)
s=0
K=int(input())
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            s=s+gcd(i,j,k)
print(s)

### FIXED CODE ###

import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)
s=0
K=int(input())
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            s=s+gcd(i,j,k)
print(s)
### BUGGY CODE ###

n=int(input())

def number(i):
   for j in range(1,41):
      for k in range(1,58):
         for u in range(1,101):
            if i==j*j+k*k+u*u+j*k+k*u+u*j:
               if j==k and k==u:
                  print(1)
                  return
               elif j==k or k==u:
                  print(3)
                  return
               else:
                  print(6)
                  return

   print(0)
   return

for h in range(1,n+1):
   number(h)

### FIXED CODE ###

n=int(input())
y=[0 for _ in range(10**4+1)]
for j in range(1,100):
   for k in range(1,100):
      for u in range(1,100):
         a=j*j+k*k+u*u+j*k+k*u+u*j
         if a <= 10**4:
            y[a-1]+=1
for o in range(n):
   print(y[o])
### BUGGY CODE ###

n=int(input())
a=list(map(int,input().split()))
mod = 10**9+7
suma = 0
for i in range(n-1):
    suma+= ((a[i]*sum(a[(i+1):]))%mod)
print(suma%mod)

### FIXED CODE ###

import numpy as np
n=int(input())
a=list(map(int,input().split()))
suma = 0
mod = 10**9+7
sumall = sum(a)%mod
for i in range(n-1):
    sumall -= a[i]
    suma+= (a[i]*sumall)%mod
print(suma%mod)
### BUGGY CODE ###

N,K = map(int, input().split())
V = [int(v) for v in input().split()]


def f(L, i, n):
    if i == 0 or len(L) == 0:
        return 0
    if L[n] >= 0:
        t = L[n]
        if n >= 0:
            n += 1
        else:
            n -= 1
        return t+f(L,i-1,n)
    else:
        t = L[n]
        if n >= 0:
            n += 1
        else:
            n -= 1
        if i >= 2:
            return max(f(L, i-2, n), t+f(L, i-1, n))
        else:
            return t+f(L, i-1, n)
    

t = min(K+1, N)
L1 = [0]*(t)
L2 = [0]*(t)
cnt1 = 0
cnt2 = 0
for j in range(t):
    if V[j] <= 0:
        cnt1 += 1
    if cnt1 <= j:
        L1[j] = f(V, j, 0)
    if V[t-j-1] <= 0:
        cnt2 += 1
    if cnt2 <= j:
        L2[t-j-1] = f(V, t-j-1, -1)
    
V_sort = sorted(V)
s = sum(V)
ans = 0
for i in range(1, K+1):
    if i >= N:
        c = s
        j = 0
        while j < N:
            if V_sort[j] < 0:
                c -= V_sort[j]
            else:
                j = N
            j += 1
        ans = max(ans, c)
    else:
        c = 0
        for j in range(i+1):
            c = max(c, L1[j]+L2[i-j])
        ans = max(ans, c)
        
print(ans)

### FIXED CODE ###

N,K = map(int, input().split())
V = [int(v) for v in input().split()]

ans = 0
for i in range(K+1):
    if i < N:
        for j in range(i+1):
            temp1 = V[:j]
            temp2 = V[N-(i-j):]
            temp = temp1 + temp2
            temp.sort()
            s = sum(temp)
            k = 0
            while k < len(temp) and k < K-i:
                if temp[k] < 0:
                    s -= temp[k]
                k += 1
            ans = max(ans, s)
    else:
        temp = sorted(V)
        s = sum(temp)
        j = 0
        while j < min(N, i-N):
            if temp[j] < 0:
                s -= temp[j]
            j += 1
        ans = max(ans, s)
        
print(ans)
### BUGGY CODE ###

import sys
import copy


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    n = ni()
    X = nl()
    X_s = sorted(X)
    for i in range(n):
        X_s_c = copy.copy(X_s)
        X_s_c.remove(X[i])
        print(X_s_c[(n - 1) // 2])


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    n = ni()
    X = nl()
    X_s = sorted(X)
    mid = X_s[n // 2]
    del_mid = (X_s[:n // 2] + X_s[n // 2 + 1:])[(n - 1) // 2]
    for x in X:
        if x < mid:
            print(mid)
        elif x > mid:
            print(X_s[n // 2 - 1])
        else:
            print(del_mid)


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

import bisect
a = int(input())
l = list(map(int,input().split()))
l.sort()
s = 0
for n,x in enumerate(l):
    for m,y in enumerate(l[n+1:]):
        # print(n+m+2)
        t = x + y
        s += bisect.bisect_left(l[n+m+2:],t)


print(s)



### FIXED CODE ###

import bisect
a = int(input())
l = list(map(int,input().split()))
l.sort()
s = 0
for n,x in enumerate(l):
    for m,y in enumerate(l[n+1:]):
        # print(n+m+2)
        t = x + y
        s += bisect.bisect_left(l[n+m+2:],t)


print(s)
### BUGGY CODE ###

N = int(input())
s= [input() for i in range(N)]
ans=0
for i in range(N):
        for k in range(i+1,N):
                A=list(s[i])
                for j in list(s[k]):
                        if j in A:
                                A.remove(j)
                if len(A) == 0:
                        ans += 1

print(ans)


### FIXED CODE ###

import math
def cmb(n, r):
        if r > n: 
                return 0
        return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


import collections
N = int(input())
s= [input() for i in range(N)]
ans=0
#各文字列文字列をソート
s=list(map(sorted,s))

s.sort()        #リストをソート
s=list(map(''.join,s))  #リストになっていたものを文字列に変換
clist = collections.Counter(s) #リスト内の各要素の数を数え上げ
kaisu=list(clist.values())

for i in kaisu:
        ans += cmb(i,2)

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

N = int(input())
X = list(map(int, input().split()))
temp = 0
for i in range(N):
    temp = X[i]
    X[i] = 0
    print(sorted(X)[int(N/2)])
    X[i] = temp

### FIXED CODE ###

N = int(input())
X = list(map(int, input().split()))
Xs = sorted(X)
for i in range(N):
    if X[i] < Xs[int(N/2)]:
        print(Xs[int(N/2)])
    else:
        print((Xs[int(N/2)-1]))
### BUGGY CODE ###

(k, s),  = [list(map(int, s.split())) for s in open(0)]

pairs = []
for i in range(k + 1):
    for j in range(k + 1):
        for l in range(k + 1):
            if i + j + l == s:
                pairs.append((i, j, l))
print(len(pairs))

### FIXED CODE ###

sk = list(map(int, input().split()))

num = 0
for x in range(sk[0] + 1):
	for y in range(sk[0] + 1):
		if x + y <= sk[1] and sk[1] - x - y <= sk[0]:
			num += 1
        

print(num)
### BUGGY CODE ###

def count(x1,y1,x2,y2):
    res = 0
    for i in range(N):
        s1 = x[i]
        s2 = y[i]
        if x1 <= s1 <= x2 and y1 <= s2 <= y2:
            res += 1
    return res 

    
N,K = map(int,input().split())
x = []
y = []
y_dict = {}
for i in range(N):
    a,b = map(int,input().split())
    x.append(a)
    y.append(b)
    y_dict[a] = b
x_2 = sorted(x)
y_2 = sorted(y)
ans = 10**20

for i in range(len(x_2)-1):#長方系の左の辺をx座標を取得し,固定
    for j in range(i+1,len(x_2)):#長方形の右の辺のx座標を取得し,固定

        y_list = []

        for k in range(i,j+1):#区間内にある点のy座標を取得しy_listに入れる
            y_list.append(y_dict[x_2[k]])
        
        y_list = sorted(y_list)
        

        if 2 <= len(y_list):
            for l in range(len(y_list)-1):#yの大きい値から順に組み合わせを試す
                for m in range(l+1,len(y_list)):
                
                    x1 = x_2[i]
                    y1 = y_list[l]
                    x2 = x_2[j]
                    y2 = y_list[m]
                    point = count(x1,y1,x2,y2)#区間内の点の数
                    
                    
                    if K <= point :
                        ans = min(ans,(x2-x1)*(y2-y1)) 


               
print(ans) 

### FIXED CODE ###

from itertools import combinations as comb

def count(x1,y1,x2,y2):
    res = 0
    for x,y in point:
        if x1 <= x <= x2 and y1 <= y <= y2:
            res += 1
    return res 
    
N,K = map(int,input().split())

x = []
point = []
y_dict = {}

for i in range(N):
    a,b = map(int,input().split())
    x.append(a)
    point.append((a,b))
    y_dict[a] = b#yの値はxの値と紐づけしておく

x = sorted(x)
ans = 10**20

number = [i for i in range(N)]
C = list(comb(number,2))

for i,j in C:#組合せで調べる
    y_list = []

    for k in range(i,j+1):#xの指定区間内にある点のy座標を取得しy_listに入れる
        y_list.append(y_dict[x[k]])
        
    y_list = sorted(y_list)
        

    if 2 <= len(y_list):
        number2 = [i for i in range(len(y_list))]
        C_2 = list(comb(number2,2))

        for l,m in C_2:        
                x1 = x[i]
                y1 = y_list[l]
                x2 = x[j]
                y2 = y_list[m]
                n = count(x1,y1,x2,y2)#区間内の点の数
                   
                if K <= n :
                    ans = min(ans,(x2-x1)*(y2-y1)) 
               
print(ans)
### BUGGY CODE ###

R,G,B,N = map(int,input().split())
cnt = 0
for r in range(N//R+1):
    for g in range(N//G+1):
        if  (N - r*R - g*G) >= 0 and  (N - r*R - g*G)%B == 0 :
            cnt +=1
            #print(r,g,(N - r*R - g*G)//B)
print(cnt)

### FIXED CODE ###

R,G,B,N = map(int,input().split())
cnt = 0
for r in range(N+1):
    for g in range(N+1):
        if  (N - r*R - g*G) >= 0 and  (N - r*R - g*G)%B == 0 :
            cnt +=1
            #print(r,g,(N - r*R - g*G)//B)
print(cnt)
### BUGGY CODE ###

def main():
    N=int(input())
    S=input()
    ans=0
    for i in range(N-2):
        for j in range(i+1,N-1):
            lis=["R","G","B"]
            if S[i]!=S[j]:
                lis=["R","G","B"]
                lis.remove(S[i])
                lis.remove(S[j])
                k=S[j+1:].count(lis[0])
                ans=ans+k
            if j+(j-i)<N and S[i]!=S[j]:
                if S[j+(j-i)]!=S[i] and S[j+(j-i)]!=S[j]:
                    ans-=1
    print(ans)

main()


### FIXED CODE ###

def main():
    N=int(input())
    S=input()
    k1=S.count("R")
    k2=S.count("B")
    ans=k1*k2*(len(S)-k1-k2)
    for i in range(N-2):
        for j in range(i+1,N-1):
            if j+(j-i)<N and S[i]!=S[j]:
                if S[j+(j-i)]!=S[i] and S[j+(j-i)]!=S[j]:
                    ans-=1
    print(ans)
main()
### BUGGY CODE ###

x,y,z,k=map(int, input().split())
a=sorted(list(map(int, input().split())),reverse=True)
b=sorted(list(map(int, input().split())),reverse=True)
c=sorted(list(map(int, input().split())),reverse=True)

a=a[:k]
b=b[:k]

sum_ab=[]

for i in a:
    for j in b:
      sum_ab.append(i+j)

sorted(sum_ab,reverse=True)

sum_abc=[]
for i in sum_ab:
    for j in c:
      sum_abc.append(i+j)

sum_abc.sort(reverse=True)
for v in sum_abc[:k]:
    print(v)

### FIXED CODE ###

x,y,z,k=map(int, input().split())
a=list(map(int, input().split()))
b=list(map(int, input().split()))
c=list(map(int, input().split()))
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)

t=[]

for i in a:
    for j in b:
      t.append(i+j)

t.sort(reverse=True)
t=t[:min(k,x*y)]

ans=[]
for i in c:
    for j in t:
      ans.append(i+j)

ans.sort(reverse=True)
for i in range(k):
    print(ans[i])