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

#abc139d
N = int(input())

if N>2:
    ans=0

    for i in range(2,N,1):
        ans+=i
    print(ans+1)
elif N==2:
    print("1")
elif N==1:
    print("0")

### FIXED CODE ###

#139D

#ここから試験用コード
'''
import itertools

for N in range(1,13):
    l = [i for i in range(1,N+1)]

    ans = 0
    ans_permutation = list()

    for permutation in itertools.permutations(l, N):
        temp_ans = 0
        permutation = [0] + list(permutation)
        for i in range(1,N+1):
            temp_ans += i%permutation[i]

        if ans <= temp_ans:
            if ans < temp_ans:
                ans_permutation = list()
            ans = temp_ans    
            ans_permutation.append(list(permutation)[1:])

    print(N,ans,ans_permutation)
    
#試験用コードの結果
# 1  0 [[1]]
# 2  1 [[2, 1]]
# 3  3 [[1, 3, 2], [2, 3, 1]]
# 4  6 [[2, 3, 4, 1]]
# 5 10 [[1, 3, 4, 5, 2], [2, 1, 4, 5, 3], [2, 3, 4, 5, 1]]
# 6 15 [[2, 3, 4, 5, 6, 1]]
# 7 21 [[1, 3, 2, 5, 6, 7, 4], [1, 3, 4, 5, 6, 7, 2], [2, 3, 1, 5, 6, 7, 4], [2, 3, 4, 5, 6, 7, 1]]
# 8 28 [[2, 1, 4, 5, 6, 7, 8, 3], [2, 3, 4, 5, 6, 7, 8, 1]]
# 9 36 [[1, 3, 4, 5, 6, 7, 8, 9, 2], [2, 3, 4, 1, 6, 7, 8, 9, 5], [2, 3, 4, 5, 6, 7, 8, 9, 1]]
#10 45 [[2, 3, 4, 5, 6, 7, 8, 9, 10, 1]]

#いずれにも最初は2,3...、最後は1となるパターンがある
#上記パターン時は ((N-1)+1)*(N-1)/2 が答え。
'''
N = int(input())
print(N*(N-1)//2)
### BUGGY CODE ###

# vim: set fileencoding=utf-8 :
x, y = map(int, raw_input().split())

if x == y:
    print(-1)
    exit()

n = 1
top = pow(10, 18)

while True:
    if n * x >= top:
        print(-1)
        break

    if n * x % y != 0:
        print(n * x)
        break

    n += 1


### FIXED CODE ###

# vim: set fileencoding=utf-8 :
x, y = map(int, raw_input().split())

if x % y == 0:
    print(-1)
    exit()

n = 1
top = pow(10, 18)

while True:
    t = n * x
    if t >= top:
        print(-1)
        break

    if t % y != 0:
        print(t)
        break

    n += 1
### BUGGY CODE ###

N = int(input())
A = [int(input()) for _ in range(N)]

a = []
i = 1
cnt = 0
while i != 2:
  a.append(i)
  cnt += 1
  i = A[i-1]
  if i == 2 or i in a:
    break

if i == 2:
  print(cnt)
else:
  print(-1)

### FIXED CODE ###

N = int(input())
A = [int(input()) for _ in range(N)]

i = 1
cnt = 0
while i != 2 and cnt <= N:
  cnt += 1
  i = A[i-1]
  if i == 2:
    break

if i == 2:
  print(cnt)
else:
  print(-1)
### BUGGY CODE ###

x,y,a,b,c = map(int, input().split())
result=sorted(list(map(int, input().split())), reverse=True)[:x]
result+=sorted(list(map(int, input().split())), reverse=True)[:y]
r=sorted(list(map(int, input().split())), reverse=True)
s = sum(result)
for el in r:
    t = el - min(result)
    if t>0:
        s += t
print(s)


### FIXED CODE ###

x, y, a, b, c = map(int, input().split())
p = sorted(list(map(int, input().split())), reverse=True)
q = sorted(list(map(int, input().split())), reverse=True)
r = sorted(list(map(int, input().split())), reverse=True)
result = p[:x] + q[:y] + r
result = sorted(result, reverse=True)
print(sum(result[:x+y]))
### BUGGY CODE ###

N = int(input())
A = []
for i in range(N):
    A.append(int(input()))

def sort(l, a):
    for i in range(len(l)):
        if(l[i] < a):
            return l[:i] + [a] + l[i+1:]
        
right_list = [A[0]]
if(N == 1):
    print(1)
else:
    for i in range(1, N):
        if(A[i] > right_list[-1]):
            if(A[i] > right_list[0]):
                right_list.pop(0)
                right_list = [A[i]] + right_list 
            else:
                right_list = sort(right_list, A[i])
        else:
            right_list.append(A[i])

print(len(right_list))


### FIXED CODE ###

from bisect import *

N = int(input())
A = []
for i in range(N):
    A.append(int(input()))

r = [10**10] * N
index = -1
for i in range(N):
    j = bisect_right(r, -A[i])
    r[j] = -A[i]
    if j > index:
        index = j
print(index + 1)
### BUGGY CODE ###

memo = {}

def dfs(i, ub):
    if i == K:
        return 1
    if (i, ub) in memo:
        return memo[(i, ub)]
    ret = 0
    x = 1
    while x <= ub and x * x <= N:
        ret = (ret + dfs(i+1, N // x)) % mod
        x += 1
    y = 1
    while y < N // y:
        cnt = min(N // y, ub) - min(N // (y + 1), ub)
        ret = (ret + cnt * dfs(i+1, y)) % mod
        y += 1
    memo[(i, ub)] = ret
    return ret

N, K = map(int, input().split())
mod = 10**9 + 7
print(dfs(0, N))

### FIXED CODE ###

from itertools import accumulate

N, K = map(int, input().split())
mod = 10**9 + 7

xs = []
x = 1
while x * x <= N:
    xs.append(N // x)
    x += 1
s = x - 1
y = 1
while y < N // y:
    xs.append(y)
    y += 1
xs = list(set(xs))
xs.sort()
compress = {x : i for i, x in enumerate(xs)}

dp = [[0] * len(compress) for _ in range(K)]
for x, i in compress.items():
    dp[-1][i] = x

for k in range(K-1)[::-1]:
    cum = list(accumulate([0] + dp[k+1]))
    for x, i in compress.items():
        a = max(compress[N // x], compress[N // s])
        dp[k][i] = (cum[-1] - cum[a]) % mod

    b = 1
    cum = [0] * len(compress)
    while b < N // b:
        cnt = N // b - N // (b + 1)
        cum[compress[b]] = (cum[compress[b]] + cnt * dp[k+1][compress[b]]) % mod
        b += 1
    cum = list(accumulate([0] + cum))
    for x, i in compress.items():
        b = N // x
        if x <= b:
            continue
        dp[k][i] += cum[-1] - cum[compress[b]+1]
        dp[k][i] += (x - N // (b + 1)) * dp[k+1][compress[b]]
        dp[k][i] %= mod
print(dp[0][-1])
### BUGGY CODE ###

def bisect_left(array, i):
    __bisect_array = array
    def _bisect_left(i, left, right):
        n = right - left + 1
        mid = (left+right) // 2
        if n == 1:
            if __bisect_array[mid] < i:
                return 1
            else:
                return 0
        if i <= __bisect_array[mid]:
            return _bisect_left(i,left,mid)
        else:
            return (mid-left+1) + _bisect_left(i,mid+1,right)
    return _bisect_left(i, 0, len(array)-1)

def bisect_right(array, i):
    __bisect_array = array
    def _bisect_right(i, left, right):
        n = right - left + 1
        mid = (right+left) // 2
        if n == 1:
            if i < __bisect_array[mid] :
                return 0
            else:
                return 1
        if __bisect_array[mid] <= i:
            return  (mid-left+1) + _bisect_right(i,mid+1,right)
        else:
           return _bisect_right(i,left,mid)
    return _bisect_right(i, 0, len(array)-1)

N = int(input())
L = []
for _ in range(3):
    l = list(map(int,input().split()))
    L.append(sorted(l))
ans = 0
for x in L[1]:
    n = bisect_left(L[0],x)
    m = bisect_right(L[2],x)
    m = N - m
    ans += n*m
print(ans)

### FIXED CODE ###

N = int(input())
L = []
for _ in range(3):
    l = list(map(int,input().split()))
    L.append(sorted(l))
import bisect
ans = 0
for x in L[1]:
    n = bisect.bisect_left(L[0],x)
    m = bisect.bisect_right(L[2],x)
    m = N - m
    ans += n*m
print(ans)
### BUGGY CODE ###

import itertools
n = int(input())
s = list(input())
list = list(itertools.combinations(s,3))
result  = []
[x for x in list if x not in result and not result.append(x)]
print(len(result))

### FIXED CODE ###

n=int(input())
S=input()
l=[]
for i in range(10**3):
    num=str(i).zfill(3)
    s=S
    if s.find(num[0])==-1: continue
    s=s[s.index(num[0])+1:]
    if s.find(num[1])==-1: continue
    s=s[s.index(num[1])+1:]
    if s.find(num[2])==-1: continue
    l.append(num)
print(len(set(l)))
### BUGGY CODE ###

import sys
readline = sys.stdin.readline

def main():
    N, K = map(int, readline().rstrip().split())
    X = list(map(int, readline().rstrip().split()))
    len_m = len([x for x in X if x < 0])
    len_p = len([x for x in X if x > 0])
    ans = 10**10
    for i in range(max(0, len_m-K), min(len_m+K, N-K+1)):
        s = X[i:i+K]
        if len(s) != K:
            continue
        if s[0] < 0 and s[-1] > 0:
            c = min(abs(s[0]) * 2 + s[-1], abs(s[0]) + s[-1] * 2)
        else:
            c = max(abs(s[0]), abs(s[-1]))
        ans = min(ans, c)

    print(ans)


if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
readline = sys.stdin.readline

def main():
    N, K = map(int, readline().rstrip().split())
    X = list(map(int, readline().rstrip().split()))
    len_m = len([x for x in X if x < 0])
    len_p = len([x for x in X if x > 0])
    ans = 10**10
    idx = max(0, len_m-K)
    s = [0] + X[idx:idx+K-1]
    for i in range(max(0, len_m-K), min(len_m+K, N-K+1)):
        s.pop(0)
        s.append(X[i+K-1])
        if len(s) != K:
            continue
        if s[0] < 0 and s[-1] > 0:
            c = min(abs(s[0]) * 2 + s[-1], abs(s[0]) + s[-1] * 2)
        else:
            c = max(abs(s[0]), abs(s[-1]))
        ans = min(ans, c)

    print(ans)


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

n = int(input())
s = input()
p = [set() for _ in range(100)]
sp = [set() for _ in range(n)]
k = int(s[-1])
sp[-1].add(k)
for j in range(n-2,1,-1):
    tmp = set(sp[j+1])
    tmp.add(int(s[j]))
    sp[j] = tmp
for x in range(n-2):
    for y in range(x,n-1):
        if x < y:
            tstr = str(s[x])+str(s[y])
            b2 = int(tstr)
            if len(p[b2]) == 9:
                pass
            else:
                p[b2] |= sp[y+1]
g =0
for c in p:
    g += len(c)
print(g)

### FIXED CODE ###

n = int(input())
s = input()
p = [set() for _ in range(100)]
sp = [set() for _ in range(n)]
k = int(s[-1])
sp[-1].add(k)
ful = False
for j in range(n-2,1,-1):
    if ful:
        sp[j] = {0,1,2,3,4,5,6,7,8,9}
    tmp = set(sp[j+1])
    if len(tmp) == 10:
        ful = True
    tmp.add(int(s[j]))
    sp[j] = tmp

s10 = [[99999 for _ in range(2)] for _ in range(10)]
for i,d in enumerate(s):
    c = int(d)
    if s10[c][0] == 99999:
        s10[c][0] = i
    elif s10[c][1] == 99999:
        s10[c][1] = i
g = 0
for i in range(10):
    for j in range(10):
        ans = 0
        nexid = min(s10[i])
        if nexid != 99999:
            for r in range(nexid+1,n-1):
                if int(s[r]) == j:
                    ans = len(sp[r+1])
                    break
            g += ans
print(g)
### BUGGY CODE ###

n = int(input())
array = []
for i in range(n+1):
    if str(i).count("3") > 0:
        if str(i).count("5") > 0:
            if str(i).count("7") > 0:
                if (str(i).count("3") + str(i).count("5") + str(i).count("7")) == len(str(i)):
                    array.append(i)
print(len(array))


### FIXED CODE ###

n = int(input())
def dfs(s):
        if int(s) > n:
                return 0
        ret = 0
        if s.count('7')>0 and s.count('5')>0 and s.count('3')>0:
            ret = 1
        for c in '753':
                ret += dfs(s + c)
        return ret
print(dfs('0'))
### BUGGY CODE ###

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

memo = [0] * n

for i in range(k - 1, len(p)):
    memo[i] = sum(p[i - k + 1:i + 1])

ans = (max(memo) + k) / 2
print(ans)


### FIXED CODE ###

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

if n != k:
    memo = [0] * (n + 1)

    for i in range(n):
        memo[i] = memo[i - 1] + p[i]

    ans = 0
    for i in range(k, n):
        ans = max(ans, memo[i] - memo[i - k])

    ans = (ans + k) / 2
    print(ans)
else:
    ans = (sum(p) + k) / 2
    print(ans)
### BUGGY CODE ###

s = list(input())
q = int(input())

for i in range(q):
    tmp_in = list(input().split())

    if tmp_in[0] == '1':
        s.reverse()
    else:
        if tmp_in[1] == '1':
            s.insert(0, tmp_in[2])
        else:
            s.append(tmp_in[2])

ans = "".join(s)
print(ans)



### FIXED CODE ###

from collections import deque

s = deque(input())
q = int(input())

rev_flag = False
for i in range(q):
    tmp_in = list(input().split())

    if tmp_in[0] == '1':
        if rev_flag:
            rev_flag = False
        else:
            rev_flag = True
    else:
        if rev_flag:
            if tmp_in[1] == '1':
                s.append(tmp_in[2])
            else:
                s.appendleft(tmp_in[2])
        else:
            if tmp_in[1] == '1':
                s.appendleft(tmp_in[2])
            else:
                s.append(tmp_in[2])

if rev_flag:
    s.reverse()

ans = "".join(s)
print(ans)
### BUGGY CODE ###

import sys
from itertools import combinations
from collections import Counter

N, X, Y = map(int, sys.stdin.readline().rstrip().split())

nodes = list(range(1, N + 1))
distance_counter = Counter()
a = Y - X - 1
p = (Y - X) // 2 + X
ans = []
for i, j in combinations(nodes, 2):
    if j - i == 1:
        continue
    distance = min(abs(X - i) + abs(Y - j) + 1, j - i)
    distance_counter[distance] += 1

for k in range(1, N):
    if k == 1:
        ans.append(N)
    else:
        ans.append(distance_counter.get(k, 0))

print('\n'.join(map(str, ans)))


### FIXED CODE ###

import sys

N, X, Y = map(int, sys.stdin.readline().rstrip().split())

nodes = list(range(1, N + 1))
ans = [0] * N
for i in range(1, N):
    for j in range(i + 2, N + 1):
        distance = min(abs(X - i) + abs(Y - j) + 1, j - i)
        ans[distance] += 1

for k in range(1, N):
    if k == 1:
        print(N)
    else:
        print(ans[k])
### BUGGY CODE ###

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

s = input()
l = [0 for _ in range(q)]
r = [0 for _ in range(q)]
for i in range(q):
	l[i],r[i] = map(int,input().split())
for i in range(q):

	a = s[l[i]-1:r[i]]
	#print(a)
	count = 0
	for j in range(len(a)-1):
		if a[j:j+2] =="AC": 
			count += 1
	print(count)

### FIXED CODE ###

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

s = input()
t = [0] * (n+1)
p = []
for i in range(n):
	t[i+1] = t[i] + (1 if s[i:i+2] =='AC' else 0)

for _ in range(q):
	l,r= map(int,input().split())
	p.append(t[r-1]-t[l-1])

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

n,x = map(int,input().split())
a = [int(i) for i in input().split()]
flag = False
for bit in range(1<<n):
    ans = []
    for i in range(n):
        mask = 1<<i
        if mask&bit:
            ans.append(a[i])
    if sum(ans)==x:
        flag = True
        break
if not flag:    
    a_new = sorted(a)
    i = 0
    while x>=0 and i < n:
        if x >= a_new[i]:
            x -= a_new[i]
        else:
            break
        i += 1
    if x>0 and i>0:
        i -= 1
    print(i)
else:
    print(len(ans))

### FIXED CODE ###

n,x = map(int,input().split())
a = [int(i) for i in input().split()]
if sum(a)<x:
    ans = n-1
elif min(a)>x:
    ans = 0
else:
    a_new = sorted(a)
    i = 0
    while i < n:
        if x >= a_new[i]:
            x -= a_new[i]
        else:
            break
        i += 1
    ans = i
print(ans)
### BUGGY CODE ###

import sys
import itertools
input = sys.stdin.readline
inf = 200000000
n, m, r = map(int, input().split())
rs = list(map(int, input().split()))
d = [[inf] * (n+1) for j in range(n+1)]
for i in range(n+1):
    d[i][i] = 0
for i in range(m):
    a, b, c = map(int, input().split())
    d[a][b] = d[b][a] = c


def update(i, j, k):
    d[i][j] = d[j][i] = min(d[i][j], d[i][k] + d[k][j])


[update(i, j, k) for k in range(1, n+1)
 for i in range(1, n+1) for j in range(i+1, n+1)]
p = list(itertools.permutations(range(r)))
s = inf
for q in p:
    t = 0
    for i in range(r-1):
        t += d[rs[q[i]]][rs[q[i+1]]]
    if s > t:
        s = t
print(s)


### FIXED CODE ###

from itertools import product, permutations


def warshall_floyd(d):
    # d        : nxn adjacent matrix
    for k, i, j in product(range(n), repeat=3):
        if d[i][j] > d[i][k] + d[k][j]:
            d[i][j] = d[i][k] + d[k][j]


INF = float("inf")
n, m, r = map(int, input().split())
r_list = list(map(lambda x: int(x) - 1, input().split()))
d = [[INF] * n for _ in range(n)]
for i in range(n):
    d[i][i] = 0
for i in range(m):
    a, b, c = map(int, input().split())
    a, b = a - 1, b - 1
    d[a][b] = d[b][a] = c
warshall_floyd(d)

ans = float("inf")
for np in permutations(r_list):
    cand = sum([d[np[i]][np[i + 1]] for i in range(r - 1)])
    ans = min(ans, cand)

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

S = input()
Q = int(input())
for q in range(Q):
  s = input()
  if len(s) == 1:
    S = S[::-1]
  else:
    s, f, c = s.split()
    if f == '1':
      S = c + S
    else:
      S = S + c

print(S)

### FIXED CODE ###

from collections import deque
d = deque(input())
Q = int(input())

# 逆フラグ
r = 1  # 1==正
for q in range(Q):
  s = input()
  if len(s) == 1:
    r *= -1
  else:
    s, f, c = s.split()
    if (f == '1' and r == -1) or (f == '2' and r == 1):
      d.append(c)
    else:
      d.appendleft(c)
ans = ''.join(d)
if r == -1:
  #d = d[::-1]
  print(ans[::-1])
else:
  print(ans)
### BUGGY CODE ###

n = int(input())
A = tuple(map(int, input().split()))
A = sorted(A)
ans = [True] * n

for i in range(n):
    ai = A[i]
    if not ans[i]:
        continue
    try:
        if ai == A[i+1]:
            ans[i] = False
    except:
        pass

    for j in range(i+1, n):
        if A[j]%ai == 0:
            ans[j] = False
print(sum(ans))


### FIXED CODE ###

from collections import Counter
n = int(input())
A = tuple(map(int, input().split()))
C = Counter(A)
A = list(set(A))
ok = [True] * (10**6+1)

for a in A:
    temp = a+a
    while temp < 10**6+1:
        ok[temp] = False
        temp += a

c = 0
for a in A:
    if C[a] == 1 and ok[a] == True:
        c += 1
print(c)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
from collections import defaultdict
def inpl(): return list(map(int, input().split()))
N = int(input())
A = inpl()

def primes(N):
    sieve = [1]*(N+1)
    sieve[:2] = [0, 0]
    P = []
    for i in range(2, N+1):
        if sieve[i]:
            for j in range(2*i, N, i):
                sieve[j] = 0
            P.append(i)
    return P

P = primes(32000)
D = defaultdict(list)

for a in A:
    for p in P:
        cnt = 0
        while a%p==0:
            cnt += 1
            a //= p
        if cnt:
            D[p].append(cnt)
    if a > 1:
        D[a].append(1)

D = {k:[0]*(len(v) == N-1) + sorted(v) for k, v in D.items() if len(v) >= N-1}

ori = 1
for k, v in D.items():
    ori *= k**v[0]

ans = max(ori, 1)
for a in A:
    tmp = 1 * ori
    for p in D.keys():
        cnt = 0
        while a%p==0:
            cnt += 1
            a //= p
        if cnt == D[p][0]:
            tmp *= p**(D[p][1] - D[p][0])
    ans = max(ans, tmp)
print(ans)
            

### FIXED CODE ###

# -*- coding: utf-8 -*-
from collections import defaultdict
def inpl(): return list(map(int, input().split()))
N = int(input())
A = inpl()

def primes(N):
    sieve = [1]*(N+1)
    sieve[:2] = [0, 0]
    P = []
    for i in range(2, N+1):
        if sieve[i]:
            for j in range(2*i, N, i):
                sieve[j] = 0
            P.append(i)
    return P

P = set(primes(32000))
D = defaultdict(list)
C = set()
for a in A:
    removes = []
    for p in P:
        cnt = 0
        while a%p==0:
            cnt += 1
            a //= p
        if cnt:
            D[p].append(cnt)
        else:
            if p in C:
                removes.append(p)
            else:
                C.add(p)
    P = P - set(removes)
    if a > 1:
        D[a].append(1)

D = {k:[0]*(len(v) == N-1) + sorted(v) for k, v in D.items() if len(v) >= N-1}

ori = 1
for k, v in D.items():
    ori *= k**v[0]

ans = max(ori, 1)
for a in A:
    tmp = 1 * ori
    for p in D.keys():
        cnt = 0
        while a%p==0:
            cnt += 1
            a //= p
        if cnt == D[p][0]:
            tmp *= p**(D[p][1] - D[p][0])
    ans = max(ans, tmp)
print(ans)
### BUGGY CODE ###

import math
from collections import deque
import sys
sys.setrecursionlimit(10**9)

def main():
    N,K = map(int,input().split())
    A = list(map(int,input().split()))

    graph = [0] * (N+1)
    for i in range(N+1): #1-indexed
        f = i
        t = A[i-1]
        graph[f] = t


    def solve():
        visited = []
        stack = deque([1])
        x = 1
        count = 0
        while len(stack) > 0:
            x = stack.pop()
            if x in visited:
                break

            visited.append(x)
            stack.append(graph[x])
            count += 1

            if count == K:
                print(stack.pop())
                exit()

        loop_head = x
        head_index = visited.index(loop_head)
        loop_len = len(visited) - head_index

        r = (K-head_index)%loop_len
        print(visited[head_index:][r])


    solve()


if __name__ == "__main__":
  main()


### FIXED CODE ###

from collections import deque
import sys
sys.setrecursionlimit(10**9)

def main():
    N,K = map(int,input().split())
    A = list(map(int,input().split()))

    graph = [0] * (N+1)
    for i in range(N+1): #1-indexed
        f = i
        t = A[i-1]
        graph[f] = t


    def solve():
        visited_set = set([])
        visited = []
        stack = deque([1])
        x = 1
        count = 0
        while len(stack) > 0:
            x = stack.pop()
            if x in visited_set:
                break

            visited_set.add(x)
            visited.append(x)
            stack.append(graph[x])
            count += 1

            if count == K:
                print(stack.pop())
                exit()

        loop_head = x
        head_index = visited.index(loop_head)
        loop_len = len(visited) - head_index

        r = (K-head_index)%loop_len
        print(visited[head_index:][r])



    solve()


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

R, G, B, N = map(int, input().split())

ans = 0
for i in range(N+1):
    for j in range(N+1):
        for k in range(N+1):
            if i * R + j * G + B * k == N:
                ans += 1
                
print(ans)

### FIXED CODE ###

R, G, B, N = map(int, input().split())

ans = 0

for g in range(N//G+1):
    for b in range(N//B+1):
        s = N-g*G-b*B
        if s < 0:
            break
        if s%R == 0:
            ans += 1

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

n, m = map(int, input().split())
count = 0
while n >= 1 and m >=2:
    n -= 1
    m -= 2
    count += 1
if m == 0:
    print(count)
else:
    count += m//4
    print(count)

### FIXED CODE ###

n, m = map(int, input().split())
if 2 * n > m:
    ans = m // 2
    print(ans)
else:
    ans = n
    m -= 2 * n
    ans += m//4
    print(ans)
### BUGGY CODE ###

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


### FIXED CODE ###

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

#15:38
x,y,z,k = map(int,input().split())
a = list(map(int,input().split()))
a.sort(reverse = True)
a = a[:k]
b = list(map(int,input().split()))
b.sort(reverse = True)
b = b[:k]
c = list(map(int,input().split()))
c.sort(reverse = True)
c = c[:k]
ab = []
for l in a:
  for m in b:
    ab.append(l+m)
ab.sort(reverse = True)
ab = ab[:k]
abc = []
for n in ab:
  for o in c:
    abc.append(n+o)
abc.sort(reverse = True)
abc = abc[:k]
for p in abc:
  print(p)

### FIXED CODE ###

#15:38
x,y,z,k = map(int,input().split())
a = list(map(int,input().split()))
a.sort(reverse = True)
a = a[:k]
b = list(map(int,input().split()))
b.sort(reverse = True)
b = b[:k]
c = list(map(int,input().split()))
c.sort(reverse = True)
c = c[:k]
ab = []
for l in a:
  for m in b:
    ab.append(l+m)
ab.sort(reverse = True)
ab = ab[:k]
abc = []
for n in ab:
  for o in c:
    abc.append(n+o)
abc.sort(reverse = True)
abc = abc[:k]
for p in abc:
  print(p)