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

n = int(input())
s = input()
count = 1
l = len(set(list(s)))
while( l!=1 ):
    if s[1]!=s[0]:
        count += 1
        s = s[1:]
    else:
        s = s[1:]
    l = len(set(list(s)))
print(count)

### FIXED CODE ###

n = int(input())
s = input()

for i in range(n):
    if i==0:
        count = 1
    else:
        if s[i]!=s[i-1]:
            count += 1
        else:
            pass
print(count)
### BUGGY CODE ###


def Burger(n, b):
  if n == 0:
    return "P"
  b += "B"
  b += Burger(n-1, "")
  b += "P"
  b += Burger(n-1, "")
  b += "B"
  return b

n, x = [int(x) for x in input().split()]
burger = Burger(n, "")
print(burger[-x:].count("P"))  

### FIXED CODE ###

def getItems(layerCount):
	if layerCount == 0:
		return 1
	return 2*getItems(layerCount-1) + 3

def getPats(layerCount):
	return 2**(layerCount + 1) - 1

def patEaten(layer, toEat):
	pattyCount = 0

	if layer == 1:
		burger = "BPPPB"

		for x in range(toEat):
			if burger[x] == "P":
				pattyCount += 1
		return pattyCount
		
	elif layer == 0:
		if toEat == 1:
			return 1
		else:
			return 0
	
	else:
		items = getItems(layer)
		if toEat == items:
			pattyCount += getPats(layer)
			return pattyCount
		elif toEat < 2+getItems(layer-1):
			if items + 1 == 2* toEat:
				toEat-=2
				return 1 + patEaten(layer - 1, toEat)
			toEat -= 1
			return patEaten(layer - 1, toEat)
		else:
			toEat -= (1+1+getItems(layer-1))
			pattyCount += 1 + getPats(layer-1)
			
			return pattyCount + patEaten(layer-1, toEat)

i, j = [int(x) for x in input().split()]
#print(patEaten(2,13))
print(patEaten(i,j))
### BUGGY CODE ###

a, b, x = map(int, input().split())
print(sum(i % x == 0 for i in range(a, b+1)))


### FIXED CODE ###

a, b, x = map(int, input().split())
if a == 0:
    print(b // x + 1)
else:
    print((b // x) - ((a - 1) // x))
### BUGGY CODE ###

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

E_P=[(1+p)/2 for p in P] 

max_ = 0
for k_ in range(len(P)-K+1):
    if max_ < sum(E_P[k_:k_+K]):
        max_=sum(E_P[k_:k_+K])
        
print(max_)

### FIXED CODE ###

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

E_P=[(1+p)/2 for p in P] 

E_P_sum=[0]
E_P_sum_=0
for n in range(N):
    E_P_sum_=E_P_sum_+E_P[n]
    E_P_sum.append(E_P_sum_)

max_ = 0
for k_ in range(len(P)-K+1):
    sum_=E_P_sum[k_+K]-E_P_sum[k_]
#     print(E_P_sum[k_+K],E_P_sum[k_],sum_)
    if max_ < sum_:
        max_=sum_
        
print(max_)
### BUGGY CODE ###

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

sum = 0
count_b = 0
count_c = 0
for a in dlist:
    count_b = count_b + 1
    count_c = count_b
    for b in range(count_b, N):
        count_c = count_c + 1
        for c in range(count_c, N):
            if a < (dlist[b] + dlist[c]):
                if dlist[b] < (dlist[c] + a):
                    if dlist[c] < (a + dlist[b]):
                        sum  = sum + 1
print(sum)


### FIXED CODE ###

import bisect
N=int(input())
L=sorted(list(map(int,input().split())))

ans=0
for i in range(N-2):
  for j in range(i+1,N-1):
    ans+=bisect.bisect_left(L,L[i]+L[j])-j-1 # Code 1 
    # ans+=bisect.bisect_left(L,L[i]+L[j],j)-j-1 # Code 2 
print(ans)
### BUGGY CODE ###

import copy
import bisect
S=input()
T=input()

sbasic=[[] for _ in range(26)]
for i,s in enumerate(S):
  sbasic[ord(s)-ord("a")].append(i)

for t in set(T):
    if len(sbasic[ord(t)-ord("a")])==0:
        print(-1)
        exit()

slist=copy.deepcopy(sbasic)
index=-1
roop=0
for t in T:
  if len(sbasic[ord(t)-ord("a")])==0:
    roop+=1
    slist=copy.deepcopy(sbasic)
    index=-1
  pos=bisect.bisect_right(sbasic[ord(t)-ord("a")],index)
  if pos==len(sbasic[ord(t)-ord("a")]):
    roop+=1
    slist=copy.deepcopy(sbasic)
    index=-1
    pos=bisect.bisect_right(sbasic[ord(t)-ord("a")],index)
  index=sbasic[ord(t)-ord("a")][pos]
  
print(len(S)*roop+index+1)
  
  
  
  
  

### FIXED CODE ###

import copy
import bisect
S=input()
T=input()

sbasic=[[] for _ in range(26)]
for i,s in enumerate(S):
  sbasic[ord(s)-ord("a")].append(i)

for t in set(T):
    if len(sbasic[ord(t)-ord("a")])==0:
        print(-1)
        exit()

slist=copy.deepcopy(sbasic)
index=-1
roop=0
for t in T:
  if len(sbasic[ord(t)-ord("a")])==0:
    roop+=1
    #slist=copy.deepcopy(sbasic)
    index=-1
  pos=bisect.bisect_right(sbasic[ord(t)-ord("a")],index)
  if pos==len(sbasic[ord(t)-ord("a")]):
    roop+=1
    #slist=copy.deepcopy(sbasic)
    index=-1
    pos=0
  index=sbasic[ord(t)-ord("a")][pos]
  
print(len(S)*roop+index+1)
### BUGGY CODE ###

n = int(input())
a = list(map(int,input().split()))
mod = 10**9+7
point = 0
kai = [2**i%mod for i in range(61)]
for i in range(61):
    now = sum(1 for j in a if(j >> i)&1)
    point += now*(n-now)*kai[i]
    point %= mod
print(point)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
mod = 10**9+7
point = 0
for i in range(61):
    now = 0
    for j in a:
        now += (j >> i&1)
    now *= n-now
    now %= mod
    for k in range(i):
        now *= 2
        now %= mod
    point += now
    point %= mod
print(point)
### BUGGY CODE ###

N = int(input())
n = N
sum = 0
for i in range(N):
    if i == 0:
        sum = 0
    else:
        sum = sum + ((i)%(i+1))

print(sum)

### FIXED CODE ###

N = int(input())
print((N*(N-1))//2)
### BUGGY CODE ###

N=int(input())
A=list(map(int,input().split()))
L=[]
R=[]
ans=0
for i in range(N):
    L.append(i+1+A[i])
    R.append(i+1-A[i])
for i in L:
    a=R.count(i)
    ans=ans+a
print(ans)

### FIXED CODE ###

import bisect
N=int(input())
A=list(map(int,input().split()))
L=[]
R=[]
ans=0
for i in range(N):
    L.append(i+1+A[i])
    R.append(i+1-A[i])
L.sort()
R.sort()
for i in L:
    l=bisect.bisect_left(R,i)
    r=bisect.bisect_right(R,i)
    ans=ans+r-l
print(ans)
### BUGGY CODE ###

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

for i in range(q):
    query = list( input().split() )
    if query[0]=="1":
        s = s[::-1]
    else:
        if query[1]=="1":
            s=query[2]+s
        else:
            s=s+query[2]
print(s)

### FIXED CODE ###


s=input()
q=int(input())
queries = []
rev = [0]*q
flag=0
for i in range(q):
    query = list( input().split() )
    queries.append( query )
    if query==["1"]:
        flag+=1
    rev[i]=flag

n_rev = flag
from collections import deque
left=deque([])
right=deque([])
for r,query in zip(rev,queries):
    if query!=["1"]:
        q1 = query[1]
        q2 = query[2]
        if (r+n_rev)%2==0:
            if q1=="1":
                left.appendleft(q2)
            else:
                right.append(q2)
        else:
            if q1=="1":
                right.append(q2)
            else:
                left.appendleft(q2) 
#     print(i,left,s,right)
if n_rev%2==1:
    s=s[::-1]
print("".join(["".join(left),s,"".join(right)]) )
### BUGGY CODE ###

n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()

for _ in range(m):
    a[-1] //= 2
    a.sort()

print(sum(a))


### FIXED CODE ###

import heapq

n, m = map(int, input().split())
a = list(map(lambda x: int(x)*(-1), input().split()))
heapq.heapify(a)

for _ in range(m):
    y = heapq.heappop(a)
    heapq.heappush(a, (-1)*(-y//2))

print(-sum(a))
### BUGGY CODE ###

# coding: utf-8

import collections

# 標準入力 <int><int>
N, X, Y = map(int, input().split())

br = []

for i in range(N - 1):
  for j in range(i + 1, N):
    br.append(min(j - i, abs(X - (i + 1)) + 1 + abs(Y - (j + 1)), abs(Y - (i + 1)) + 1 + abs(X - (j + 1))))

c = collections.Counter(br)

for k, v in c.items():
  print(v)

for _ in range(N - 1 - len(c)):
  print(0)


### FIXED CODE ###

# coding: utf-8

import collections

# 標準入力 <int><int>
N, X, Y = map(int, input().split())

br = []

for i in range(N - 1):
  for j in range(i + 1, N):
    """
    #print("(" , i+1, j+1, ")", j-i, abs(X - (i + 1)) + 1 + abs(Y - (j + 1)), abs(Y - (i + 1)) + 1 + abs(X - (j + 1)))
    """
    br.append(min(j - i, abs(X - (i + 1)) + 1 + abs(Y - (j + 1)), abs(Y - (i + 1)) + 1 + abs(X - (j + 1))))

c = collections.Counter(br)

for k, v in c.items():
  print(v)

for _ in range(N - 1 - len(c)):
  print(0)
### BUGGY CODE ###

N = int(input())
S = input()
dp = [[0]*N for i in range(N)]
pm = 0
ans = 0
for i in range(N):
  for j in range(i+1,N):
    m = 0
    x = i + dp[i-1][j-1] if i>1 else i
    y = j + dp[i-1][j-1] if i>1 else j
    while x<j and y<N and S[x]==S[y]:
      x += 1
      y += 1
      m += 1
#    print(pm,i,j)
    if m>ans:
      ans = m
    dp[i][j] = m
print(ans)


### FIXED CODE ###

N = int(input())
S = input()
dp = [[0]*N for i in range(N)]
pm = 0
ans = 0
for i in range(N-1,0,-1):
  for j in range(i-1,-1,-1):
    if S[i]==S[j]:
      if i<N-1:
        dp[i][j] = min(dp[i+1][j+1]+1, i-j)
      else:
        dp[i][j] = 1
    else:
      dp[i][j] = 0
    if dp[i][j]>ans:
      ans = dp[i][j]
print(ans)
### BUGGY CODE ###

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

k = int(input())
total = 0
for a in range(1, k+1):
  for b in range(1, k+1):
    for c in range(1, k+1):
      total += gcd(gcd(a, b), c)
print(total)


### FIXED CODE ###

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

k = int(input())
total = 0
for a in range(1, k+1):
  for b in range(a, k+1):
    for c in range(b, k+1):
      if a == b == c:
        total += gcd(gcd(a, b), c)
      elif a == b or b == c:
        total += 3*gcd(gcd(a, b), c)
      else:
        total += 6*gcd(gcd(a, b), c)
print(total)
### BUGGY CODE ###

from heapq import *
n, m = map(int, input().split())

j = []
for _ in range(n):
    a,b = map(int, input().split())
    if a <= m :
        j.append([a,b])
j.sort()
p = 0
temp = []
for i in range(1, m+1):
    while j and j[0][0] <= i:
        a,b = j.pop(0)
        heappush(temp, -b)
    if temp:
        p -= heappop(temp)
print(p)

### FIXED CODE ###


from heapq import *
n, m = map(int, input().split())

j = []
for _ in range(n):
    a,b = map(int, input().split())
    if a <= m :
        j.append((a,b))
j.sort(reverse=True)

ans = 0
q = []
for i in range(1, m+1):
    while j and j[-1][0] <= i:
        a,b = j.pop()
        heappush(q, -b)
    if q:
        ans -= heappop(q)
print(ans)
### BUGGY CODE ###

str = input()
str2 = input().split(" ")

ans = 1
for x in str2:
    ans = ans * int(x)

if(ans > 1000000000000000000):
    ans = -1

print(ans)

### FIXED CODE ###

num = int(input())
str2 = input().split(" ")
nums = [int(s) for s in str2]
nums.sort()

ans = 1

for i in range(len(nums)):
    ans = ans * nums[i]
    if(ans > 1000000000000000000):
        print(-1)
        quit()
print(ans)
### BUGGY CODE ###

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

dp=[0 for i in range(N)]

for i in range(1,N):
    dp[i]=min(dp[i-j]+abs(H[i-j]-H[i]) for j in range(1,min(K+1,i+1)))
        
print(dp[N-1])

### FIXED CODE ###

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

    ans=[0]*N
    ans[1]=abs(h[1]-h[0])


    for i in range(2,N):
        ans[i] = min(abs(h[i] - h[j]) + ans[j] for j in range(max(0,i-K),i))
    print(ans[N-1])
    
main()
### BUGGY CODE ###

import math
N = int(input())
S = input()

m = float("inf")
for i in range(N):
    cnt = 0
    for j in range(N):
        if i == j:
            continue
        elif i > j:
            if S[j] =='W':
                cnt += 1
        elif i < j:
            if S[j] == 'E':
                cnt += 1
    if m > cnt:
        m = cnt

print(m)


### FIXED CODE ###

import math
N = int(input())
S = input()

w = [0]*N
e = [0]*N
if S[0] == 'W':
    w[0] += 1
if S[N-1] == 'E':
    e[N-1] += 1
for i in range(1,N):
    w[i] = w[i-1]
    e[N-i-1] = e[N-i]
    if S[i] == 'W':
        w[i] += 1
    if S[N-i-1] == 'E':
        e[N-i-1] += 1

m = float("inf")
for i in range(N):
    cnt = w[i] + e[i] - 1
    if cnt < m:
        m = cnt
print(m)
### BUGGY CODE ###

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


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

def score(a, k):
    now = p[a]
    s = c[now]
    cnt = 1
    ans = s
    while now != a and cnt < k:
        now = p[now]
        s += c[now]
        ans = max(ans, s)
        cnt += 1
    if cnt == k:
        return ans
    if k % cnt == 0:
        return (k // cnt - 1) * s + ans
    s = (k // cnt) * s
    k %= cnt
    cnt = 0
    while cnt < k:
        now = p[now]
        s += c[now]
        ans = max(ans, s)
        cnt += 1
    return ans

print(max(score(i, k) for i in range(n)))


### FIXED CODE ###

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

for i in range(n):
    p[i] -= 1
def score(a, k):
    now = p[a]
    s = c[now]
    cnt = 1
    l = [s]
    while now != a and cnt < k:
        now = p[now]
        s += c[now]
        l.append(s)
        cnt += 1
    if cnt == k:
        return max(l)
    l.append((k // cnt - 1) * s + max(l))
    s = (k // cnt) * s
    k %= cnt
    cnt=0
    while cnt < k:
        now = p[now]
        s += c[now]
        l.append(s)
        cnt += 1
    return max(l)
print(max(score(i, k) for i in range(n)))
### BUGGY CODE ###

s = input()
k = int(input())

data = []
for i in range(len(s)):
    for j in range(i, len(s)):
        data.append(s[i: j + 1])

data = sorted(set(data))
print(data[k - 1])

### FIXED CODE ###

s = input()
k = int(input())

data = set()
for i in range(len(s)):
    for j in range(i, i + k):
        data.add(s[i: j + 1])
data = sorted(data)
print(data[k - 1])
### BUGGY CODE ###

N=int(input())
D={}
for i in range(N):
  x,y=map(int, input().split())
  if x not in D:
    D[x]=[y,y]
  else:
    a,b=D[x][0],D[x][1]
    D[x][0]=min(a,y)
    D[x][1]=max(b,y)
d=len(D)
if len(D)==1:
  for i in D:
    print(abs(D[i][0]-D[i][1]))
    exit()
ans=0
for i in D:
  for j in D:
    if i<=j:
      a,b,c,d=D[i][0],D[i][1],D[j][0],D[j][1]
      ans=max(ans,abs(d-a)+(j-i),abs(c-b)+(j-i))
print(ans)

### FIXED CODE ###

N=int(input())
A,B=[],[]
for i in range(N):
  x,y=map(int, input().split())
  A.append(x+y)
  B.append(x-y)
  
A=sorted(A)
B=sorted(B)
print(max(abs(A[0]-A[-1]),abs(B[0]-B[-1])))
### BUGGY CODE ###

n = int(input())
a = list(map(int,input().split()))

#Aiは、Ai以外の任意の(すべての)Ajで割り切れない
unans = 0
for i in a:
  count = 0
  for j in a:
    if i % j == 0:
      count += 1
    if count >= 2:
      unans += 1
      break
   
print(n - unans)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))

m = max(a)
#約分できちゃう数値リスト
lis = [0]*(m + 1)
for i in a:
  for j in range(i, m + 1, i):
    lis[j] += 1
#iが1なら、lisの要素全てに+1されてる。
count = 0
for i in a:
  if lis[i] == 1:
    count += 1
    
print(count)
### BUGGY CODE ###

def mod_inv(a, m):
    return pow(a, m - 2, m)


def combination(a, b):
    if b > a - b:
        return combination(a, a - b)
    if b < 0:
        return 0
    ans_mul = 1
    ans_div = 1
    for i in range(b):
        ans_mul *= a - i
        ans_div *= i + 1
        ans_mul %= MOD
        ans_div %= MOD
    ans = ans_mul * mod_inv(ans_div, MOD)
    return ans


N, K = map(int, input().split())
A = sorted(map(int, input().split()))
MOD = 10 ** 9 + 7
# max
mx = 0
mn = 0
for i in range(N):
    mx += A[i] * combination(i, K - 1)
    mn += A[i] * combination(N - i - 1, K - 1)
    mx %= MOD
    mn %= MOD
print((mx - mn) % MOD)


### FIXED CODE ###

from collections import defaultdict


def combination(a, b):
    if b > a - b:
        return combination(a, a - b)
    return fact[a] * ifact[b] * ifact[a-b]


N, K = map(int, input().split())
A = sorted(map(int, input().split()))
MOD = 10 ** 9 + 7
# 階乗を前処理
fact = defaultdict(int)
fact[0] = 1
for i in range(1, N+1):
    fact[i] = fact[i-1] * i
    fact[i] %= MOD
# 階乗の逆元を前処理
ifact = defaultdict(int)
ifact[N] = pow(fact[N], MOD-2, MOD)
for i in reversed(range(1, N + 1)):
    ifact[i-1] = ifact[i] * i
    ifact[i-1] %= MOD

mx = 0
mn = 0
for i in range(N):
    mx += A[i] * combination(i, K - 1)
    mn += A[i] * combination(N - i - 1, K - 1)
    mx %= MOD
    mn %= MOD
print((mx - mn) % MOD)
### BUGGY CODE ###

k,n=map(int,input().split())
a=list(map(int,input().split()))
d=0
for i in range(n-1):
    d=max(sorted(a)[i+1]-sorted(a)[i],d)
d=max(k+sorted(a)[0]-sorted(a)[n-1],d)
print(k-d)

### FIXED CODE ###

k,n=map(int,input().split())
a=list(map(int,input().split()))
d=0
for i in range(n-1):
    d=max(a[i+1]-a[i],d)
d=max(k+a[0]-a[n-1],d)
print(k-d)
### BUGGY CODE ###

import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    for _ in range(k):
        tmp = [0] * n
        for i in range(n):
            for j in range((i+1) - a[i], (i+1) + a[i] + 1):
                if 1 <= j <= n:
                    tmp[j-1] += 1
            if len(set(tmp)) == 1 and n in set(tmp):
                print(*tmp)
                return
        a = tmp.copy()
    print(*a)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
import numpy as np
from numba import njit, i8
input = lambda: sys.stdin.readline().rstrip()

@njit(i8[:](i8[:]), cache=True)
def count(a):
    tmp = np.zeros_like(a)
    for index, num in enumerate(a):
        left = max(0, index-num)      
        right = min(len(a)-1, index+num)  
        tmp[left] += 1              
        if right + 1 < len(a):
            tmp[right + 1] -= 1
    tmp = np.cumsum(tmp)
    return tmp

def main():
    n, k = map(int, input().split())
    a = np.array(list(map(int, input().split())))
    for _ in range(k):
        a = count(a)
        if len(set(a)) == 1 and n in set(a):
            print(*a)
            return
    print(*a)

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

s = input()
if s[-1] == "?":
    pre = [1 if i<10 else 0 for i in range(13)]
else:
    pre = [0 for i in range(13)]
    pre[int(s[-1])] = 1
n = 10**9 + 7
for i in range(1, len(s)):
    t = 10**i % 13
    if s[-1*i-1] == "?":
        c = pre.copy()
        for j in range(1,10):
            te = t*j % 13
            for k in range(13):
                c[k] = c[k] + pre[(13+k-te)%13]
        pre = c.copy()
        for k in range(13):
            pre[k] %= n
    else:
        te = int(s[-1*i-1])*t % 13
        pre = pre[13-te:]+pre[:13-te]
print(pre[5])

### FIXED CODE ###

s = input()
pre = [1]+[0]*12
n = 10**9 + 7
tem = [[i*j%13 for i in range(10)] for j in range(13)]
t = 1
for i in range(len(s)):
    if s[-1*i-1] > "9":
        pre = [sum([pre[k-i] for i in tem[t]])%n for k in range(13)]      
    else:
        te = int(s[-1*i-1])*t % 13
        pre = [pre[i-te] for i in range(13)]
    t = t*10 % 13
print(pre[5])
### BUGGY CODE ###

k, s = map(int, input().split())
# print(k, s)
count = 0
for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            # print(x, y, z)
            if x + y + z == s:
                count += 1
print(count)

### FIXED CODE ###

k, s = map(int, input().split())
# print(k, s)
count = 0
for x in range(k+1):
    for y in range(k+1):
        # print(x, y)
        if 0 <= s - x - y <= k:
            count += 1
print(count)
### BUGGY CODE ###

n = int(input())
a = list(map(int,input().split()))
b = []

for i in range(n):
    b.append(a[i])
    b = b[::-1]
for i in range(n-1):
    print('{0} '.format(b[i]), end='')
print(b[-1])


### FIXED CODE ###

from collections import deque

n = int(input())
a = list(map(int,input().split()))
b = deque([a[0]])

for i in range(1,n):
    if i%2==(n-1)%2:
        b.appendleft(a[i])
    else:
        b.append(a[i])
    
print(' '.join(map(str,b)))
### BUGGY CODE ###

import copy
N = int(input())
A = [int(input()) for i in range(N)]
A_copy = copy.deepcopy(A)
for i in range(N):
    A = copy.deepcopy(A_copy)
    A.pop(i)
    print(max(A))


### FIXED CODE ###

import copy
N = int(input())
A = [int(input()) for i in range(N)]
set_A = list(set(A))
set_A.sort(reverse=True)
A_copy = copy.deepcopy(A)
A_copy.sort(reverse=True)
Max = max(A)
cnt = 0
for i in range(N):
    if A[i] == Max:
        cnt += 1
for i in range(N):
    if A[i] == Max:
        if cnt > 1:
            print(Max)
        else:
            print(set_A[1])
    else:
        print(Max)
### BUGGY 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()))

L = [0] * (4000000)

for i in range(len(A)):
    for j in range(len(B)):
        tmp = A[i] + B[j] 
        L[i*1000+j] = tmp

L.sort(reverse=True)

ans_list = [0] * (4000000)

for i in range(min(K,len(L))):
    for j in range(len(C)):
        tmp = L[i] + C[j]
        ans_list[i*1000+j] = tmp

ans_list.sort(reverse=True)


for i in range(K):
    print(ans_list[i])

### 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()
b.sort()
c.sort()

bc = [0] * (y * z)
q = 0
for i in range(y):
    for j in range(z):
        bc[q] = b[i] + c[j]
        q += 1

bc.sort(reverse=True)
r = len(bc)
bc = bc[:min(k, r)]

abc = [0] * (x * min(k, r))
q = 0
for i in range(min(k, r)):
    for j in range(x):
        abc[q] = bc[i] + a[j]
        q += 1

abc.sort(reverse=True)
for i in range(min(k, x*y*z)):
    print(abc[i])
### BUGGY CODE ###

import sys 
import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
A = list(map(int,readline().split()))
A_sort = list(np.sort(A)[::-1])
A_index = list(np.argsort(A)[::-1])

dp = [-float('inf')]*(N+1)
dp[0] = 0

for i in range(N):
    dp_new = [-float('inf')]*(N+1)
    pi = A_index[i]  #もともといた場所
    for l in range(i+1): 
        r = i - l   #右を選んだ回数
        dp_new[l+1] = max(dp_new[l+1],dp[l] + A_sort[i] * (pi-l)) 
        dp_new[l] = max(dp_new[l],dp[l] + A_sort[i] * ((N-r-1)-pi))
    dp = dp_new
print(max(dp))

### FIXED CODE ###

import sys 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
A = list(map(int,readline().split()))

A = [(A[i], i) for i in range(N)]
A_sort = sorted(A,reverse = True)

dp = [-float('inf')]*(N+1)
dp[0] = 0

for i in range(N):
    dp_new = [-float('inf')]*(N+1)
    pi = A_sort[i][1]  #もともといた場所
    for l in range(i+1): 
        r = i - l   #右を選んだ回数
        dp_new[l+1] = max(dp_new[l+1],dp[l] + A_sort[i][0] * (pi-l)) 
        dp_new[l] = max(dp_new[l],dp[l] + A_sort[i][0] * ((N-r-1)-pi))
    dp = dp_new
print(max(dp))
### BUGGY CODE ###

In = input().split(" ")
T = int(In[0])
A = int(In[1])
K = int(In[2])
 
if K>=T+A:
  print("0 0")
  
elif (K > T):
  print("0 {0}".format(A-(K-T)))
elif (T > K):
  print("{0} {1}".format(T-K, A))
else:
  for i in range(K):
    if T >= 1:
      T -= 1
    elif A >= 1:
      A -= 1
    else:
      break
  print("{0} {1}".format(T, A))

### FIXED CODE ###

In = input().split(" ")
T = int(In[0])
A = int(In[1])
K = int(In[2])
 
if K <= T:
  print("{0} {1}".format(T-K,A))
elif K <= T+A:
  print("0 {0}".format(A-(K-T)))
else:
  print("0 0")