Harryxun/stf_run huggingface dataset:
import sys
from collections import deque
import copy
import math

def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline


def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [S] = [(input_raw[0])]
    input_raw = read_func().strip().split()
    [K] = [int(input_raw[0])]
##    if len(S) >= K:
##        min_s = "zzzzzzz"
##        for i in range(len(S) - K):
##            if S[i : i + K]< min_s:
##                min_s = S[i : i + K]
##        print min_s
##        return
##    else:
    sub_list = set([])
    for i in range(len(S)):
        for j in range(i + 1, len(S)):
            sub_list.add(S[i:j])

    sub_list = list(sub_list)
    sub_list.sort()
    print sub_list[K - 1]


if __name__ == '__main__':
    main()


### FIXED CODE ###


import sys
from collections import deque
import copy
import math

def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline


def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [S] = [(input_raw[0])]
    input_raw = read_func().strip().split()
    [K] = [int(input_raw[0])]
##    if len(S) >= K:
##        min_s = "zzzzzzz"
##        for i in range(len(S) - K):
##            if S[i : i + K]< min_s:
##                min_s = S[i : i + K]
##        print min_s
##        return
##    else:
    sub_list = set([])
    for i in range(len(S)):
        for j in range(i + 1, i + 6):
            sub_list.add(S[i:j])

    sub_list = list(sub_list)
    sub_list.sort()
    print sub_list[K - 1]


if __name__ == '__main__':
    main()
N, K = map(int, input().split())
mod = 10 ** 9 + 7

s = 0
tmp = 1
for _ in range(N)
    tmp *= K
    tmp %= mod
s = tmp
for i in range(K+1):
    baisuu = K % i
    tmp = 1
    for _ in range(N)
        tmp *= baisuu
        tmp %= mod
    s += tmp * (i - 1)

print(s)

### FIXED CODE ###

from functools import lru_cache


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

@lru_cache
def gcd1_tuples(k):
    if k == 1:
        return 1
    tmp = pow(k, N, mod)
    for j in range(2, k+1):
        tmp -= gcd1_tuples(k//j)
        tmp %= mod
    return tmp

s = 0
for i in range(1, K+1):
    s += gcd1_tuples(K//i) * i
    s %= mod

print(s)
n = int(input())
s = input()
t = s[0:n//2]
if s = t+t:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n = int(input())
s = input()
if n % 2 != 0:
  print("No")
else:
  T = s[0:n//2]
  if T + T == s:
    print("Yes")
  else:
    print("No")
N , Q = map(int, input().split())
S = input()
LR = [[int(i) for i in input().split()] for j in range(Q)]
T = list(S)
AC_list = []

for i in range(len(T)):
    if T[i] == "A" and T[i+1] == "C":
        AC_list.append(i)

for i in LR:
    n = len([k for k in AC_list if k>=i[0]-1 and k<i[1]-1])
    print(n)


### FIXED CODE ###

N , Q = map(int, input().split())
S = input()
LR = [[int(i)-1 for i in input().split()] for j in range(Q)]
T = list(S)
ACtimes = [0] * len(T)

for i in range(1,len(T)):
    if T[i-1] == "A" and T[i] == "C":
        ACtimes[i] = ACtimes[i-1] + 1
    else:
        ACtimes[i] = ACtimes[i-1]

for k in LR:
    print(ACtimes[k[1]] - ACtimes[k[0]])
A, B, C, D= [int(input() )for _ in range(4)]
D = A+B
E = C+D
if D>E:
    print("Left")
elif D<E:
    print("Right")
else:
    print("Balanced")

### FIXED CODE ###

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

if (g[0]+g[1])> (g[2]+g[3]):
    print("Left")
elif (g[0]+g[1])< (g[2]+g[3]):
    print("Right")
else:
    print("Balanced")
n, m = (int(i) for i in input().split())  
a = [[int(i) for i in input().split()] for i in range(n)] 
dic = {}
lis = []
 
for x in a:
  if x[0] not in dic:
  	dic[x[0]] = x[1]
  else:
    dic[x[0]] += x[1]

sorted_dict = sorted(dic.items(), key=lambda x:x[0])
 
count = 0
for x in sorted_dict:
  if len(lis) > m:
    break
  else:
    lis += [int(x[0])] * int(x[1])
    count += x[1]
  
#print(lis)
print(sum(lis[:m]))

### FIXED CODE ###

n, m = (int(i) for i in input().split())  
a = [[int(i) for i in input().split()] for i in range(n)] 
dic = {}
lis = []

a.sort()
ans = 0
for x in a:
  if x[1] >= m:
    ans += x[0] * m
    break
  else:
    ans += x[0] * x[1]
    m -= x[1]

print(ans)
n = list(map(int,input().split()))
 if n.count(int (5)) == 2 and n.count(int (7)) == 1:
    print("YES")
  else:
    print("NO")
 

### FIXED CODE ###

n = list(map (int, input().split()))
if n.count(int (5)) == 2 and n.count(int (7)) == 1:
  print("YES")
else:
  print("NO")
def main():
    n = input()

    array = [2,1]
    for i in range(100):
        array.append(array[i]+array[i+1])
    print(array[n])


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    n = int(input())

    array = [2,1]
    for i in range(100):
        array.append(array[i]+array[i+1])
    print(array[n])


if __name__ == '__main__':
    main()
import sys
readline = sys.stdin.buffer.readline
 
n = int(readline())
num = 1
res = 0
for i in readline().split():
  if num != int(i):
    res += 1
  else:
    i += 1

if res == n:
  print(-1)
else:
  print(res)

### FIXED CODE ###

import sys
readline = sys.stdin.buffer.readline

n = int(readline())
c = 1
r = 0
p = 0
a = True
for i, j in enumerate(readline().split()):
  if c != int(j):
    continue
  else:
    a = False
    c += 1
    r += i - p
    p = i + 1
if a:
  print(-1)
else:
  print(r + n - p)
radius = input()

print(radius * radius)

### FIXED CODE ###

r = input()
print(int(r) * int(r))
N,M = map(int,input().split())
S = str(input())
SA = list(S)
D = ["a" , "b" , "c"]

if SA[M] == "A":
    SA[M] = D[0]
elif SA[M] == "B":
    SA[M] = D[1]
elif SA[M] == "C"
    SA[M] = D[2]

M = ''.join(SA)

print(M)

### FIXED CODE ###

N,M = map(int,input().split())
S = str(input())
SA = list(S)
D = ["a" , "b" , "c"]

if SA[M-1] == "A":
    SA[M-1] = D[0]
elif SA[M-1] == "B":
    SA[M-1] = D[1]
elif SA[M-1] == "C":
    SA[M-1] = D[2]

M = ''.join(SA)

print(M)
import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    sys.setrecursionlimit(10**7)
    INF = 10**5 + 1
    MOD = 10**9 + 7
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())
    SI = lambda : sys.stdin.readline().rstrip()

    N,M = LI()
    S = SI()
    N0 = 2 ** (N-1).bit_length()
    st = [INF] * (2*N0)

    def update(i,x):
        i += N0-1
        st[i] = x
        while i > 0:
            i = (i-1) // 2
            st[i] = min(st[i*2+1], st[i*2+2])

    def query(l,r):
        L = l+N0; R = r+N0
        ret = INF
        while L < R:
            if L % 2:
                ret = min(ret,st[L-1])
                L += 1
            if R % 2:
                R -= 1
                ret = min(ret,st[R-1])
            L //= 2; R //= 2
        return ret

    update(0,0)

    for i in range(1,N+1):
        if S[i] == '1': continue
        else:
            if i <= M:
                update(i,1)
            else:
                x = query(i-M,i)
                update(i,x+1)
    if st[N+N0-1] >= INF:
        print(-1)
    else:
        ans = []
        g = st[N+N0-1]
        f = 0
        s = 1
        d = 0
        last_i = 0
        for i in range(1,N+1):
            if st[i+N0-1] == s+1:
                ans.append(d)
                f = last_i
                s += 1
            if st[i+N0-1] == s:
                d = i - f
                last_i = i
        ans.append(N-f)
        print(*ans,sep=' ')

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    sys.setrecursionlimit(10**7)
    INF = 10**5 + 1
    MOD = 10**9 + 7
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())
    SI = lambda : sys.stdin.readline().rstrip()

    N,M = LI()
    S = SI()
    N0 = 2 ** N.bit_length()
    st = [INF] * (2*N0)

    def update(i,x):
        i += N0-1
        st[i] = x
        while i > 0:
            i = (i-1) // 2
            st[i] = min(st[i*2+1], st[i*2+2])

    def query(l,r):
        L = l+N0; R = r+N0
        ret = INF
        while L < R:
            if L % 2:
                ret = min(ret,st[L-1])
                L += 1
            if R % 2:
                R -= 1
                ret = min(ret,st[R-1])
            L //= 2; R //= 2
        return ret

    update(0,0)

    for i in range(1,N+1):
        if S[i] == '1': continue
        else:
            if i <= M:
                update(i,1)
            else:
                x = query(i-M,i)
                update(i,x+1)
    if st[N+N0-1] >= INF:
        print(-1)
    else:
        ans = []
        f = N
        last_i = N
        s = st[N+N0-1]
        d = 1
        cnt = 0
        for i in range(N-1,-1,-1):
            cnt += 1
            if st[i+N0-1] == s-1:
                d = f - i
                last_i = i
            if cnt == M:
                ans.append(d)
                f = last_i
                s -= 1
                cnt = f - i
        if f > 0:
            ans.append(f)
        print(*reversed(ans),sep=' ')

if __name__ == '__main__':
    main()
S = input()
w = input()
ans = ''

for i in range(0, len(S), w):
    lit = S[i:i+w]
    ans = ans + lit[0]

print(ans)
    

### FIXED CODE ###

S = input()
w = input()
w = int(w)
ans = ''

for i in range(0, len(S), w):
    lit = S[i:i+w]
    ans = ans + lit[0]

print(ans)
import sys
sys.setrecursionlimit(1000000)

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

D = [0]

def f(a):
  if a <= N:
    M = max(A[a:N+1])
    Mi = A.index(M)
    m = min(A[a-1:Mi])
    d = M - m
    if D[-1] == d:
      D.append(d)
    elif D[-1] < d:
      D.clear()
      D.append(d)
    f(Mi+2)
  else:
    pass

f(1)

result = len(D)
print(result)


### FIXED CODE ###

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

B = []
Amin = A[0]

for i in range(1, N):
  if A[i] < Amin:
    Amin = A[i]
  else:
    B.append(A[i] - Amin)

result = B.count(max(B))
print(result)
n,x=map(int,input().split())
li=map(input().split())
d=0
c=1
for l in li:
  	d=d+l
	if d>x:
		break
	
	c=c+1
	
print(c)


### FIXED CODE ###

x, a=map(int, input().split())
if	x < a:
	l = 0
else:
	l = 10
print(l)
N = int(input())
m = 1
for n in range(n):
  i = int(input())
  m = m * i
  if m > 10 ** 18:
    m = -1
    break
print(m)

### FIXED CODE ###

N = int(input())
m = 1
for n in input().split():
  i = int(n)
  m = m * i
  if m > 10 ** 18 or m < 0:
    m = -1
print(m)
s, t = input()
print(sum(s[i] == t[i] for i in range(3)))


### FIXED CODE ###

s = input()
t = input()
print(sum(s[i] == t[i] for i in range(3)))
import copy

class Node:
    def __init__(self, i):
        self.num = i
        self.goto = []
        self.kenken = set()

N, M = map(int, input().split())
nodes = [Node(i+1) for i in range(N)]

for i in range(M):
    u, v = map(int, input().split())
    u -= 1
    v -= 1
    nodes[v].goto.append(nodes[u])

s, t = map(int, input().split())
s -= 1
t -= 1

for i in range(N):
    for next in nodes[i].goto:
        for nextnext in next.goto:
            nodes[i].kenken = nodes[i].kenken | set(nextnext.goto)
    if nodes[i] in nodes[i].kenken:
        nodes[i].kenken.remove(nodes[i])

node = nodes[t]
step = 0
prev = []
check_list = [[node, step, prev]]
ok = False
while len(check_list) > 0:
    node, step, tmp = check_list.pop(0)
    prev = copy.deepcopy(tmp)
    if node == nodes[s]:
        print(step)
        ok = True
        break
    for next in node.kenken:
        if next not in prev:
            check_list.append([next, step+1, prev+[next]])
if not ok:
    print(-1)


### FIXED CODE ###

N, M = map(int, input().split())
nodes = [[] for i in range(N)]

for i in range(M):
    u, v = map(int, input().split())
    u -= 1
    v -= 1
    nodes[u].append(v)

s, t = map(int, input().split())
s -= 1
t -= 1

num = s
step = 0
q = [[num, step]]
check = [[False for i in range(N)] for j in range(3)]
ok = False
while len(q) > 0:
    num, step = q.pop(0)
    tmp = step % 3
    if tmp == 0 and num == t:
        print(step//3)
        ok = True
        break
    for next in nodes[num]:
        if not check[tmp][next]:
            check[tmp][next] = True
            q.append([next, step+1])
if not ok:
    print(-1)
K = int(input())
X = int(input())
print ('Yes' if 500 * K => X else 'No')

### FIXED CODE ###

a = input().split()
K = int(a[0])
X = int(a[1])
if 500 * K >= X:
    print('Yes')
else:
    print('No')
def root(x):
    if c[x] == x:
        return x
    else:
        c[x] = root(c[x])
        return c[x]


def uni(x,y):
    rx = root(x)
    ry = root(y)
    c[ry] = rx


n, m = map(int, input().split())
c = [i for i in range(n)]
for i in range(m):
    x, y, z = map(int, input().split())
    x -= 1
    y -= 1
    uni(x,y)

for i in range(n):
    root(i)

print(len(set(c)))


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)


def root(x):
    if c[x] == x:
        return x
    else:
        c[x] = root(c[x])
        return c[x]


def uni(x,y):
    rx = root(x)
    ry = root(y)
    c[ry] = rx


n, m = map(int, input().split())
c = [i for i in range(n)]
for i in range(m):
    x, y, z = map(int, input().split())
    x -= 1
    y -= 1
    uni(x,y)

for i in range(n):
    root(i)

print(len(set(c)))
N, M = map(int, input().split())
ab = [0] * M
for i in range(M):
    ab[i] = list(map(int, input().split()))

import sys
sys.setrecursionlimit(100500)

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

uf = UnionFind(N)

for i in range(M):
    uf.union(ab[i][0], ab[i][1])

print(uf.group_count() - 1)


### FIXED CODE ###

N, M = map(int, input().split())
ab = [0] * M
for i in range(M):
    ab[i] = list(map(int, input().split()))

import sys
sys.setrecursionlimit(100500)

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

uf = UnionFind(N)

for i in range(M):
    uf.union(ab[i][0]-1, ab[i][1]-1)

print(uf.group_count() - 1)
A,B,C,D = [int(i) for i in input().split()]

S1 = int(A*B)
S2 = int(C*D)

if S1 >= S2:
    print(S1)
else:
    return 0
if S2 >= S1:
    print(S2)
else:
    return 0


### FIXED CODE ###

A,B,C,D = [int(i) for i in input().split()]

S1 = int(A*B)
S2 = int(C*D)

if S1 >= S2:
    print(S1)
elif S2 > S1:
    print(S2)
def kaibun(str):
    return True if str == str[::-1] else False

s = input()
if not kaibun(s) :
    print('No')
    return
n = len(s)
n1 = (n - 1) // 2
if not kaibun(s[:n1]) :
    print('No')
    return
n2 = (n + 3) // 2 - 1
if not kaibun(s[n2:]) :
    print('No')
    return
print('Yes')

### FIXED CODE ###

def resolve():
    s = input()
    if not kaibun(s) :
        print('No')
        return
    n = len(s)
    n1 = (n - 1) // 2
    if not kaibun(s[:n1]) :
        print('No')
        return
    n2 = (n + 3) // 2 - 1
    if not kaibun(s[n2:]) :
        print('No')
        return
    print('Yes')

def kaibun(str):
    return True if str == str[::-1] else False

resolve()
import numpy as np
import math
while True:
    n= int(input())
    if n == 0:
        quit()
    a=list(map(int,input().split()))
    m=np.mean(a)
    s=0
    for i in a:
        s+=(i-m)**2
    s/=n
    print("{0:.8f}".format(math.sqrt(s)))

### FIXED CODE ###

while True:
    n = int( input() )
    if n==0:
        break
    a=list(map(int, input().split()))
    m=sum(a)/n
    s=0
    for i in a:
        s+=(i-m)**2
    print( ( s/n)**0.5 )
import sys
N=int(input())
a=[list(map(int,input().split())) for i in range(N)]
a.sort(key=lambda x: x[2],reverse=True)
ans=[]

if a[1][2]==0:
    print(ans[0][0],ans[0][1],ans[0][2])

for i in range(0,101):
    for j in range(0,101):
        p=a[0][2]+abs(i-a[0][0])+abs(j-a[0][1])
        q=a[1][2]+abs(i-a[1][0])+abs(j-a[1][1])
        if p==q:
            for k in range(2,N):
                if a[k][2]>0 and a[k][2]+abs(i-a[k][0])+abs(j-a[k][1])!=p : break
                elif a[k][2]==0 and a[k][2]+abs(i-a[k][0])+abs(j-a[k][1])<=p : break
                if k==N-1:
                    print(i,j,p)
                    sys.exit()

        if p==100: print(i,j,100)

### FIXED CODE ###

import sys
N=int(input())
a=[list(map(int,input().split())) for i in range(N)]
a.sort(key=lambda x: x[2],reverse=True)
ans=[]

if a[0][2]==100:
    print(a[0][0],a[0][1],a[0][2])
    sys.exit()



for i in range(0,101):
    for j in range(0,101):
        p=a[0][2]+abs(i-a[0][0])+abs(j-a[0][1])
#       q=a[1][2]+abs(i-a[1][0])+abs(j-a[1][1])
        for k in range(1,N):
            if a[k][2]>0 and a[k][2]+abs(i-a[k][0])+abs(j-a[k][1])!=p : break
            elif a[k][2]==0 and a[k][2]+abs(i-a[k][0])+abs(j-a[k][1])<p : break
            if k==N-1:
                print(i,j,p)
                sys.exit()
s = int(input())

print(2018 + s[5:])

### FIXED CODE ###

s = input()
 
print('2018' + s[4:])
s = input()
len_s = len(s)
ans = 0
for i in range(len_s - 3):
    for j in range(i + 4 , len_s + 1):
        if int(s[i:j]) % 2019 == 0:
            ans += 1
print(ans)

### FIXED CODE ###

s, w =[int(i) for i in input().split()]
if w >= s:
    print('unsafe')
else:
    print('safe')
x=int(input())
for _ in range(x):
	num=list(map(int,input().split()))
	b,c=0,0
	flag=True
	for d in num:
		if b < d:
			b=i
		elif c<i:
			c=i
		else:
			print("NO")
			flag=False
			break
	if flag:
		print("YES")


### FIXED CODE ###

x=int(input())
for _ in range(x):
	num=list(map(int,input().split()))
	b,c=0,0
	flag=True
	for i in num:
		if b<i:
			b=i
		elif c<i:
			c=i
		else:
			print("NO")
			flag=False
			break
	if flag:
		print("YES")
a = input()
if (a[3] == a[4]) and (a[5] == a[6]):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

a = input()
if (a[2] == a[3]) and (a[4] == a[5]):
    print("Yes")
else:
    print("No")
N = input()
otsuri = N % 1000
if otsuri > 0
    orsuri = 1000 - otsuri
print(otsuri)

### FIXED CODE ###

N = int(input())
otsuri = N % 1000
if not otsuri == 0:
    otsuri = 1000 - otsuri
print(otsuri)
#L, R = map(int,input().split())
H,N = map(int,input().split())
A = list(map(int,input().split()))
 
a = 0
for i in A:
  a += i
  
if a>=H:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

#L, R = map(int,input().split())
H,A = map(int,input().split())

r = H % A
if r == 0:
  ans = H/A
else:
  ans = (H-r)/A+1

print(int(ans))
n, y = map(int, input().split())
    yen = [1000, 5000, 10000]
     
    def f():
      for i range(n):
        r = yen[2] * i
        if r > y:
          continue
        for j range(n):
          if i + j > n:
            continue
          r += yen[1] * j  + yen[1] * (n - i -j)
          if r == y:
            print('{} {} {}'.format(i, j, n - i - j))
            return
      print('-1 -1 -1')
     
    f()

### FIXED CODE ###

n, y = map(int, input().split())
yen = [1000, 5000, 10000]

def f():
    for i in range(n+1):
        r = yen[2] * i
        if r > y:
            continue
        for j in range(n+1):
            if i + j > n:
                continue
            if r + yen[1] * j + yen[0] * (n - i -j)== y:
                print('{} {} {}'.format(i, j, n - i - j))
                return
    print('-1 -1 -1')

f()
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from itertools import permutations, accumulate
from math import sqrt, ceil, floor, factorial, gcd
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
#from fractions import gcd
import sys
def I(): return int(input())  # '123' -> 123
def Is(): return map(int, input().split())  # '123 456' -> 123, 456
def LI(): return list(map(int, input().split()))  # '123 456' -> [123, 456]
def TI(): return tuple(map(int, input().split()))  # '123 456' -> (123, 456)
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()  # 'aa bb' -> 'aa','bb' or ['aa','bb']
def LS(): return list(input())  # 'abc123' -> ['a','b','c','1','2','3']
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(1000000)
MOD = 1000000007
INF = float('inf')

a, b, k = Is()
if a > k:
    print("{} {}".format(a-k, b))
elif a + b > k:
    print(("0 {}".format(b-k+a)))
else:
    print("0 0")

### FIXED CODE ###

from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from itertools import permutations, accumulate
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
#from fractions import gcd
#from math import gcd
import sys
def I(): return int(input())  # '123' -> 123
def Is(): return map(int, input().split())  # '123 456' -> 123, 456
def LI(): return list(map(int, input().split()))  # '123 456' -> [123, 456]
def TI(): return tuple(map(int, input().split()))  # '123 456' -> (123, 456)
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()  # 'aa bb' -> 'aa','bb' or ['aa','bb']
def LS(): return list(input())  # 'abc123' -> ['a','b','c','1','2','3']
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(1000000)
MOD = 1000000007
INF = float('inf')

a, b, k = Is()
if a > k:
    print("{} {}".format(a-k, b))
elif a + b > k:
    print(("0 {}".format(b-k+a)))
else:
    print("0 0")