Problem:


Score : 200 points

Problem Statement

Takahashi has A cookies, and Aoki has B cookies.
Takahashi will do the following action K times:

If Takahashi has one or more cookies, eat one of his cookies.

Otherwise, if Aoki has one or more cookies, eat one of Aoki's cookies.

If they both have no cookies, do nothing.

In the end, how many cookies will Takahashi and Aoki have, respectively?

Constraints

0 \leq A \leq 10^{12}

0 \leq B \leq 10^{12}

0 \leq K \leq 10^{12}

All values in input are integers.

Input

Input is given from Standard Input in the following format:

A B K

Output

Print the numbers of Takahashi's and Aoki's cookies after K actions.

Sample Input 1

2 3 3

Sample Output 1

0 2

Takahashi will do the following:

He has two cookies, so he eats one of them.

Now he has one cookie left, and he eats it.

Now he has no cookies left, but Aoki has three, so Takahashi eats one of them.

Thus, in the end, Takahashi will have 0 cookies, and Aoki will have 2.

Sample Input 2

500000000000 500000000000 1000000000000

Sample Output 2

0 0

Watch out for overflows.



Sample input:
2 3 3


Sample output:
0 2

Submission status: Time Limit Exceeded

Solution code:
A,B,K = map(int,input().split())

if K >= A+B:
    print(str(0)+' '+str(0))

else:
    for i in range(K):
        if A > 0:
            A -= 1
        elif B > 0:
            B -= 1
    print(str(A)+' '+str(B))

Submission status: Time Limit Exceeded

Solution code:
A,B,K =  map(int,input().split())

for i in range(K):
    if A>=1:
        A=A-1
    elif B>=1:
        B=B-1
    else:
        break
    
print("{} {}".format(A, B))

Submission status: Time Limit Exceeded

Solution code:
a,b,k=map(int,input().split())

for i in range(k):
  if a > 0:
  	a -= 1
  else:
    b -= 1
print(a,b)

Submission status: Time Limit Exceeded

Solution code:
ABK = input().split()
A = int(ABK[0])
B = int(ABK[1])
K = int(ABK[2])

cookie_eaten = 0

while (cookie_eaten != K):
    if (A > 0):
        A -= 1
    else:
        B -= 1

    cookie_eaten += 1

print(str(A) + " " + str(B))

Submission status: Time Limit Exceeded

Solution code:
A, B, K = (int(i) for i in input().split()) 
 
for j in range(K):
  if A >0:
    A -= 1
  elif B >0:
    B -= 1
  else:
    break
 
print(A, B)

Submission status: Time Limit Exceeded

Solution code:
from sys import stdin
lines = stdin.readlines()
 
A, B, K = map(int, lines[0].split())

for i in range(K):
  if A >= 1:
    A -= 1
  elif A == 0 and B >= 1:
    B -= 1
  elif A == 0 and B == 0:
    print("0", "0")

print(A, B)

Submission status: Time Limit Exceeded

Solution code:
a,b,k = map(int, input().split())
for i in range(k):
    if a>=1:
        a-=1
    elif b>=1:
        b-=1
    else:
        break
print(a,b)

Submission status: Time Limit Exceeded

Solution code:
a,b,k = map(int, input().split())
for i in range(k):
  if a>=1:
    a-=1
  elif b>=1:
    b-=1
  else:
    print(0,0)
    exit()
print(a,b)

Submission status: Time Limit Exceeded

Solution code:
At,Ba,K = (int(x) for x in input().split())

for i in range(K):
    if At >= 1:
        At -= 1
    elif Ba >= 1:
        Ba -= 1
    
print(At)
print(Ba)

Submission status: Time Limit Exceeded

Solution code:
list = [int(i) for i in input().split()]
while(list[2]!=0):
    if(list[0]!=0 or list[1]!=0):
        if(list[0]>=1):
            list[0]=list[0]-1
            list[2]=list[2]-1
        elif(list[1]>=1):
            list[1]=list[1]-1
            list[2]=list[2]-1
        else:
            list[2]=list[2]-1
    else:
        break
print(list[0], list[1])

Submission status: Time Limit Exceeded

Solution code:
from sys import stdin, stdout

input = stdin.readline()[:-1].split(' ')

takahashi = int(input[0])
aoki = int(input[1])
k = int(input[2])

for n in range(k):
    if takahashi > 0:
        takahashi -= 1
    elif aoki > 0:
        aoki -= 1

print('{} {}'.format(takahashi, aoki))

Submission status: Time Limit Exceeded

Solution code:
import sys
input = sys.stdin.readline

ta_c,ao_c,num = map(int,input().split())

for i in range(num):
    if ta_c > 0:
        ta_c -=1
    elif ao_c >0:
        ao_c -=1

print(ta_c,ao_c)

Submission status: Time Limit Exceeded

Solution code:
A,B,K=map(int,input().split())

for i in range(K):
  if A>=1:
    A=A-1
  elif B>=1:
    B=B-1
  elif A==0 and B==0:
    pass

print(A,B)

Submission status: Time Limit Exceeded

Solution code:
A,B,K = map(int,input().split())
while(K > 0):
    if A > 0:
        A -= 1
    else:
        B -= 1
    K -= 1
print(A,B)

Submission status: Time Limit Exceeded

Solution code:
import math
A, B, K = map(int, input().split())

if A > K:
    A = A - K
    print(A, end=" ")
    print(B)
    exit(0)

if K > A:
    K = K - A
    A = 0
    if K >= B:
        K = K - B
        B = 0
    if B > K:
        B = B - K
        print(A, end=" ")
        print(B)
        exit(0)
    
    
for i in range(K):
    if A >= 1:
        A -= 1
    elif B >= 1:
        B -= 1
    if A == 0 and B == 0:
        break

print(A, end=" ")
print(B)

Submission status: Time Limit Exceeded

Solution code:
a,b,k=(int(i)for i in input().split())
for i in range(k):
    if 0<a:a=a-1
    elif 0<b:b=b-1
print(a,b)

Submission status: Time Limit Exceeded

Solution code:
a,b,c=input().split()

a=int(a)
b=int(b)
c=int(c)

for i in range(c):
    if a>=1:
        a=a-1
    else:
        if b>=1:
            b=b-1
        else:
            pass
          
print(a,b)

Submission status: Time Limit Exceeded

Solution code:
a,b,k = map(int, input().split())
for i in range(k):
  if a == 0 and b == 0:
    print(0,0)
    exit()
  if a>=1:
    a-=1
    continue
  elif b>=1:
    b-=1
print(a,b)

Submission status: Time Limit Exceeded

Solution code:
a,b,k = map(int, input().split())

count = 0

for _ in range(k):
  if a>=1:
    a -= 1
  elif a==0 and b >= 1:
      b -= 1

print(a, b)

Submission status: Time Limit Exceeded

Solution code:
A,B,K = map(int,input().split())
while True:
    if K > 0:
        if A > 0:
            A -= 1
            K -= 1
        if A == 0 and K != 0:
            if B == 0:
                break
            else: continue
            B -= 1
            K -= 1
    else: break
print (A,B)

Submission status: Time Limit Exceeded

Solution 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
  print("{0} {1}".format(T, A))

Submission status: Time Limit Exceeded

Solution code:
takahasi, aoki, n = map(int,input().split())

for i in range(n):
    if takahasi >= 1:
        takahasi = takahasi - 1
    elif aoki >= 1:
        aoki = aoki -1
    else:
      continue
print(str(takahasi) + ' ' + str(aoki))

Submission status: Time Limit Exceeded

Solution code:
list = [int(i) for i in input().split()]
while(list[2]!=0):
    if(list[0]>=1):
        list[0]=list[0]-1
        list[2]=list[2]-1
    elif(list[1]>=1):
        list[1]=list[1]-1
        list[2]=list[2]-1
    else:
        list[2]=list[2]-1
print(list[0], list[1])

Submission status: Time Limit Exceeded

Solution code:
A,B,K = map(int,input().split())
for i in range(1,K+1):
  if(A>0):
    A=A-1
  elif(B>0):
    B=B-1
  elif(A==0 and B==0):
    A=A
    B=B
print(A,B)

Submission status: Time Limit Exceeded

Solution code:
a,b,k=(int(i)for i in input().split())
while 0<k:
    if 0<a:a=a-1
    elif 0<b:b=b-1
    k=k-1
print(a,b)

Submission status: Time Limit Exceeded

Solution code:
import math
A, B, K = map(int, input().split())

if A > K:
    A = A - K
    print(A, end=" ")
    print(B)
    exit(0)

if K > A:
    K = K - A
    A = 0
    if K >= B:
        K = K - B
        B = 0
    
    
for i in range(K):
    if A >= 1:
        A -= 1
    elif B >= 1:
        B -= 1
    if A == 0 and B == 0:
        break

print(A, end=" ")
print(B)

Submission status: Time Limit Exceeded

Solution code:
a,b,k=map(int,input().split())
for i in range(k):
  if a>0:
    a-=1
  elif b>0:
    b-=1
print(a,b)

Submission status: Time Limit Exceeded

Solution code:
def main():
    A,B,K = map(int,input().split())
    for i in range(0,K):
        if A > 0:
           A = A - 1
        elif B > 0:
            B = B - 1
    print(A,B)
 
if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
a, b, k = map(int, input().split())

for i in range(k):
    if a > 0:
        a = a - 1
    elif b > 0:
        b = b - 1

print(a, b)

Submission status: Time Limit Exceeded

Solution code:
Int = list(map(int, input().split()))
A = Int[0]
B = Int[1]
K = Int[2]

for k in range(0,K):
    if A >= 1:
        A -= 1
    elif B >= 1:
        B -= 1
    elif A == 0 and B == 0:
        None
print(A)
print(B)

Submission status: Time Limit Exceeded

Solution code:
in_li = list(map(int,input().split()))
A = in_li[0]
B = in_li[1]
K = in_li[2]
if A + B == K :
    print("0 0")
elif A > K :
    print(A-K,"",B)
else :
    for i in range(K) :
        if A != 0 :
            A -= 1
        elif B != 0 :
            B -= 1
        else :
            pass
    print(A,"",B)

Submission status: Time Limit Exceeded

Solution code:
A, B, K = map(int, input().split())

while(K>0):
    if A == 0 and B == 0:
        break
    if A > 0:
        A -= 1
        K -= 1
        continue
    if B > 0:
        B -= 1
        K -= 1
        continue

print(A, B)

Submission status: Time Limit Exceeded

Solution code:
a, b, k = [ int(_) for _ in input().split() ]

if k >= a+b:
  print(0, 0)
  exit()

while k > 0:
  k -= 1
  if a >= 1:
    a -= 1
    pass
  elif b >= 1:
    b -= 1
    
print(a, b)

Submission status: Time Limit Exceeded

Solution code:
AA,BB,KK=input().split()
A=int(AA)
B=int(BB)
K=int(KK)
for i in range(K):
  A=A-1
  K=K-1
  if(A==0):
      break
for i in range(K):
    B=B-1
    if(B==0):
        break
print(A,B)

Submission status: Time Limit Exceeded

Solution code:
A, B, K  = list(map(int, input().split()))
for i in range(K):
    if A >= 1:
        A = A-1
    elif B >= 1:
        B = B-1
    elif A == 0 and B == 0:
        pass
print(A,B)

Submission status: Time Limit Exceeded

Solution code:
A, B, K = [int(i) for i in input().split()]

for i in range(1, K+1):
  if A >= 1:
    A -= 1
  elif B >= 1:
    B -= 1
  else:
    break

print(str(A)+' '+str(B))

Submission status: Time Limit Exceeded

Solution code:

def main()->None:
    A, B, K = map(int, input().split())
    range_K = range(K)
    
    for k in range_K:
        if A >= 1:
            A -= 1
        elif B >= 1:
            B -= 1
        if A == 0 and B == 0:
            continue

    print(A, B)





if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
ta_c,ao_c,num = map(int,input().split())
 
for i in range(num):
    if ta_c > 0:
        ta_c -=1
    elif ao_c >0:
        ao_c -=1
 
print("{} {}".format(ta_c,ao_c))

Submission status: Time Limit Exceeded

Solution code:
info = [int(i) for i in  input().split()]
t, a, k = info
for i in range(k):
    if t > 0:
        t -= 1
    elif a > 0:
        a -= 1
    else:
        break
print(t, a)

Submission status: Time Limit Exceeded

Solution code:
A,B,K=map(int,input().split())
for num in range(K):
    if A>=1:
        A-=1
    elif B>=1:
        B-=1
    else:
        pass
print("{} {}".format(A,B))

Submission status: Time Limit Exceeded

Solution code:
in_li = list(map(int,input().split()))
A = in_li[0]
B = in_li[1]
K = in_li[2]
if A + B == K :
    print("0 0")
else :
    for i in range(K) :
        if A != 0 :
            A -= 1
        elif B != 0 :
            B -= 1
        else :
            pass
    print(A,"",B)

Submission status: Time Limit Exceeded

Solution code:
A, B, K = [int(i) for i in input().split()]

a = A
b = B

for _ in range(K):
    if a > 0:
        a -= 1
    elif b > 0:
        b -= 1

print("%d %d" % (a, b))

Submission status: Time Limit Exceeded

Solution code:
A,B,K = map(int,input().split())

for i in range(K):
    if A > 0:
        A -= 1
    elif B > 0:
        B -= 1
print(str(A)+' '+str(B))

Submission status: Time Limit Exceeded

Solution code:
a, b, k = [int(x) for x in input().split()]
while k > 0:
  if a > 0:
    a -= 1
  elif b > 0:
    b -= 1
  k -= 1
print(a, b)

Submission status: Time Limit Exceeded

Solution code:
a, b, k = [int(x) for x in input().split()]
for i in range(k):
    if a!=0:
        a-=1
        k-=1
    else:
        b-=1
        k-=1
print(str(a)+" "+str(b))

Submission status: Time Limit Exceeded

Solution code:
A, B, K = [int(i) for i in input().split()]

for i in range(K):
    if A > 0:
        A = A - 1
    elif B > 0:
        B = B - 1
    else:
        break

print('{} {}'.format(A,B))

Submission status: Time Limit Exceeded

Solution code:
A, B, K = [int(i) for i in input().split()]

for i in range(0,K):
  if A >= 1:
    A = A - 1
  elif B >= 1:
    B = B - 1

print(A, B)

Submission status: Time Limit Exceeded

Solution code:
import sys
i = input().split()
a=int(i[0])
b=int(i[1])
k=int(i[2])
r = max(a,b,k)
if r >1000000000000:
 print("0 0")
 sys.exit()
for _ in range(k):
  if a > 0:
    a = a-1
  else:
    b = b-1
print(str(a) + " " + str(b))

Submission status: Time Limit Exceeded

Solution code:
import sys
i = input().split()
a=int(i[0])
b=int(i[1])
k=int(i[2])
r = max(a,b,k)
for _ in range(k):
  if a > 0:
    a = a-1
  else:
    b = b-1
print(str(a) + " " + str(b))

Submission status: Time Limit Exceeded

Solution code:
a,b,k=map(int,input().split())

for i in range(k):
  if a > 0:
  	a -= 1
  else:
    b -= 1
print(a,b)

Submission status: Time Limit Exceeded

Solution code:
a, b, k = map(int, input().split(" "))

for i in range(k):
  if (a+b) == 0:
    break
  if a >= 1:
    a -= 1
  else:
    b -= 1
print(a, b)

Submission status: Time Limit Exceeded

Solution code:
a,b,k=input().split()
a=int(a)
b=int(b)
k=int(k)
for i in range(k):
	if a>0:
		a=a-1
	elif b>0:
		b=b-1
print(a,b)

Submission status: Time Limit Exceeded

Solution code:
a, b ,c= input().split()
a = int(a)
b = int(b)
c = int(c)
for i in range(c):
    if a > 0:
        a = a - 1
    elif b > 0:
        b = b - 1
print(str(a)+" "+str(b))

Submission status: Time Limit Exceeded

Solution code:
A, B, K = map(int, input().split())


for i in range(K):
    if A >0:
        A -= 1
    elif A==0 and B>0:
        B -= 1
    else:
        pass
    
print(A, B)

Submission status: Time Limit Exceeded

Solution code:
A, B, K = [int(n) for n in input().split()]
for i in range(K):
    if A>=1:
        A -= 1
    elif B>=1:
        B -= 1
print(A,B)

Submission status: Time Limit Exceeded

Solution code:
a, b, k=map(int, input().split())


for i in range(k):
    if a>=1:
        a -=1
    elif a<1 & b>=1:
        b -=1
    else:
        a=b=0
print(a,b)

Submission status: Time Limit Exceeded

Solution code:
li = list(map(int,input().split()))
a=li[0]
b=li[1]
k=li[2]
i = 1
while i <= k:
    if a >= 1:
        a = a-1
    elif b >= 1:
        b = b-1
    else:
        break
    i += 1


print(str(a)+" "+str(b))

Submission status: Time Limit Exceeded

Solution code:
a, b, k = map(int,input().split())

for i in range(k):
  if a > 0:
    a -= 1
  elif b > 0:
    b -= 1
print(a, b)

Submission status: Time Limit Exceeded

Solution code:
a,b,k=map(int,input().split())
for i in range(k):
    if a>=1:
        a-=1
    else:
        b-=1
l=[]
l.append(a)
l.append(b)
print(' '.join(map(str, l)))

Submission status: Time Limit Exceeded

Solution code:
import sys

A, B, K = [int(num) for num in input().split()]

if A + B == K:
    print(0, 0)
    sys.exit(0)

if K > A:
    K = K - A
    A = 0

while K:
    if A > 0:
        A -= 1
        K -= 1
        continue
    if B > 0:
        B -= 1
        K -= 1
        continue
print(A, B)

Submission status: Time Limit Exceeded

Solution code:
a,b,k = map(int, input().split())

for _ in range(k):
  if a>=1:
    a -= 1
  elif a==0:
    if b >= 1:
      b -= 1
  else:
    pass
  
print(a, b)

Submission status: Time Limit Exceeded

Solution code:
a,b,k = map(int, input().split())
for i in range(k):
  if a>=1:
    a-=1
    continue
  elif b>=1:
    b-=1
    continue
  if a == 0 and b == 0:
    print(0,0)
    exit()
print(a,b)

Submission status: Time Limit Exceeded

Solution code:
A = list(map(int,input().split()))
for i in range(A[2]):
    if A[0] > 0:
        A[0] -= 1
    elif A[1] > 1:
        A[1] -=1
print(A[0],A[1])

Submission status: Time Limit Exceeded

Solution code:
a,b,k = map(int, input().split())
for i in range(k):
  if a>=1:
    a-=1
  elif b>=1:
    b-=1
  if a == 0 and b == 0:
    print(0,0)
    exit()
print(a,b)

Submission status: Time Limit Exceeded

Solution code:
A, B, K = map(int,input().split())

for i in range(K):
  if A > 0:
    A = A - 1
  elif B > 0:
    B = B - 1
print(str(A) + ' ' + str(B))

Submission status: Time Limit Exceeded

Solution code:
A,B,K = map(int,input().split())

for i in range(K):
    if A !=0:
        A = A-1
    else:
        B = B-1

print(A,B)

Submission status: Time Limit Exceeded

Solution code:
a = list(map(int,input().split()))

for i in range(a[2]):
  if a[0] != 0:
    a[0] = a[0] - 1
  elif a[1] != 0:
    a[1] = a[1] - 1

print(a[0],a[1])

Submission status: Time Limit Exceeded

Solution code:
A, B, K = map(int, input().split())

for _ in range(K):
    if A:
        A -= 1
    elif B:
        B -= 1
else:
    print(A, B)

Submission status: Time Limit Exceeded

Solution code:
a,b,k = list(map(int,input().split()))

for i in range(k):
  if a >0:
    a -=1
  else:
    b -=1
    
print(str(a) + " " +str(b))

Submission status: Time Limit Exceeded

Solution code:
a,b,k=map(int,input().split())
if a+b>k:
    for i in range(k):
        if a>=1:
            a-=1
        elif a<1 and b>=1:
            b-=1
else:
    a,b=0,0
print(a,b)

Submission status: Time Limit Exceeded

Solution code:
A, B, K = [int(i) for i in input().split()]
for i in range(K):
    if A:
        A -= 1
    elif B:
        B -= 1
print(A, B)

Submission status: Time Limit Exceeded

Solution code:
takahashi, aoki, kaisu = [int(x) for x in input().split()]
for i in range(kaisu):
    if(takahashi>0):
        takahashi = takahashi - 1
    elif(aoki>0):
        aoki = aoki-1
print(str(takahashi) + " " + str(aoki))

Submission status: Time Limit Exceeded

Solution code:
a = list(map(int,input().split()))

for i in range(a[2]):
    if a[0] > 0:
        a[0] -= 1
        continue
    if a[1] > 0:
        a[1] -=1
        continue

print(a[0],a[1])

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8

Tak, Ao, K = (int(n) for n in input().split())
for i in range(K):
  if Tak > 0:
    Tak -= 1
  elif Ao > 0:
    Ao -= 1
print(Tak, Ao)

Submission status: Time Limit Exceeded

Solution code:
a, b, k = map(int, input().split(' '))

for i in range(k):
    if a != 0:
        a -= 1
    elif b != 0:
        b -= 1

print(a, b)

Submission status: Time Limit Exceeded

Solution code:
a, b, k = [int(x) for x in input().split()]

cnt = 0
while (cnt < k):
  cnt += 1
  if a > 0:
    a -= 1
  elif b > 0:
    b -= 1

print(a, b)

Submission status: Time Limit Exceeded

Solution code:
a, b, k = map(int, input().split())
for i in range(k):
    if a >= 1:
        a -= 1
    elif b >= 1:
        b -= 1
    else:
        break

print(a, b)

Submission status: Time Limit Exceeded

Solution code:
ta_c,ao_c,num = map(int,input().split())

for i in range(num):
    if ta_c > 0:
        ta_c -=1
    elif ao_c >0:
        ao_c -=1

print("{} {}".format(ta_c,ao_c))

Submission status: Time Limit Exceeded

Solution code:
a,b,k = map(int, input().split())

while k:
    if a>=1:
        a-=1
    elif b>=1:
        b-=1
    k-=1

print(a,b)

Submission status: Time Limit Exceeded

Solution code:
a, b, c = map(int, input().split())

for i in range(c):
    if a >= 1:
        a -= 1
    elif b >= 1:
        b -= 1

print(a, b)

Submission status: Time Limit Exceeded

Solution code:
a, b, k = map(int, input().split())
for i in range(k):
    if a > 0:
        a -= 1
    elif b > 0:
        b -= 1
print(a, b, sep=' ')

Submission status: Time Limit Exceeded

Solution code:
a,b,k=map(int,input().split())
for i in range(k):
    if a>=1:
        a-=1
    elif b>=1:
        b-=1
l=[]
l.append(a)
l.append(b)
print(' '.join(map(str, l)))

Submission status: Time Limit Exceeded

Solution code:
a , b ,c =map(int,input().split())
for k in range(c):
    if a >= 1:
        a -= 1
    elif b >= 1:
        b -= 1
ans = str(a) +str(" ")  + str(b)
print(ans)

Submission status: Time Limit Exceeded

Solution code:
A, B, K = map(int, input().split())
while True:
  if A >= 1:
    A -= 1
  elif A == 0 and B >= 1:
    B -= 1
  else:
    break
  K -= 1
  if K == 0:
    break
print(A, B)

Submission status: Time Limit Exceeded

Solution code:
import sys
a, b, k = map(int, input().split())

if a + b <= k:
    print(str(0) + " " + str(0))
    sys.exit()

for i in range(k):
    if a >=1:
        a -= 1
    else:
        b -= 1

print(str(a) + " " + str(b))

Submission status: Time Limit Exceeded

Solution code:
a, b, k = map(int, input().split())

for i in range(k):
  if a >= 1:
    a-=1
  elif b >= 1:
    b-=1
print(a,b)

Submission status: Time Limit Exceeded

Solution code:
a,b,k=map(int,input().split())
for i in range(k):
    if a>0:
        a=a-1
    elif b>0:
        b=b-1
    else:
        break
print("{0} {1}".format(a,b))

Submission status: Time Limit Exceeded

Solution code:
a,b,k = map(int, input().split())
for i in range(k):
  if a>=1:
    a-=1
  elif b>=1:
    b-=1
  if a == b == 0:
    print(0,0)
    exit()
print(a,b)

Submission status: Time Limit Exceeded

Solution code:
T, A, time = map(int, input().split())

for i in range(time):
    if T>0:
        T-=1
    else:
        A-=1

print(str(T)+" "+str(A))

Submission status: Time Limit Exceeded

Solution code:
a,b,k = map(int, input().split())
for i in range(k):
    if (a > 0):
        a -= 1
    elif(b > 0):
        b -= 1
print(max(a,0),max(b,0))

Submission status: Time Limit Exceeded

Solution code:
n = list(map(int, input().split()))

for i in range(n[2]):
    if n[0] > 0:
        n[0] -= 1
    elif (n[0] == 0) and (n[1] > 0):
        n[1] -= 1

print(n[0],n[1])

Submission status: Time Limit Exceeded

Solution code:
A, B, K = [int(n) for n in input().split()]
for i in range(K):
    if A>=1:
        A -= 1
    elif B>=1:
        B -= 1
print(A,B)

Submission status: Time Limit Exceeded

Solution code:
a, b, k = map(int, input().split())

for i in range(k):
  if a > 0:
    a -= 1
  elif b > 0:
    b -= 1
  elif a==0 and b==0:
    break

print(a, b)

Submission status: Time Limit Exceeded

Solution code:
A,B,K=map(int,input().split())

for i in range(K):
    if A>=1:
        A-=1
    elif B>=1:
        B-=1
    else:
        continue

print(str(A)+' '+str(B))

Submission status: Time Limit Exceeded

Solution code:
a, b, k = map(int, input().split())

for i in range(k):
	if a > 0:
		a -= 1
	elif b > 0:
		b -= 1

print(a, b)

Submission status: Time Limit Exceeded

Solution code:
a, b, k = map(int, input().split())

for i in range(k):
    if (a >= 1):
        a -= 1
    elif (b >= 1):
        b -= 1
print("{} {}".format(a, b))

Submission status: Time Limit Exceeded

Solution code:
A, B, K = map(int, input().split())

for i in range(K):
    if A >= 1:
        A = A - 1
    elif B >= 1:
        B = B - 1
print(A, B)

Submission status: Time Limit Exceeded

Solution code:
A, B, K = map(int, input().split())

for i in range(K):
    if A > 0:
        A -= 1
    else:
        B -= 1

print(A, B)

Submission status: Time Limit Exceeded

Solution code:
A,B,K=map(int,input().split())

for i in range(K):
    if A!=0:
        A-=1
    else:
        B-=1

print("{} {}".format(A,B))

Submission status: Time Limit Exceeded

Solution code:
A,B,K = map(int,input().split())
for i in range(K):
    if A >= 1:
        A -= 1
    elif B >= 1:
        B -= 1
        
print(A, B)

Submission status: Time Limit Exceeded

Solution code:
a, b, k = map(int, input().split())
for i in range(k):
    if a > 0:
        a -= 1
    elif b > 0:
        b -= 1
    else:
        break

print(a, b)

Submission status: Time Limit Exceeded

Solution code:
A,B,K=map(int, input().split())

for i in range(K):
  if A>0:
    A-=1
  elif B>0:
    B-=1

print(A,B)

Submission status: Time Limit Exceeded

Solution code:
A,B,K = map(int,input().split())
for i in range(K) :
    if A >= 1 :
        A = A - 1
    elif B >= 1 :
        B = B - 1
    else :
        pass

print(A,B)

Submission status: Time Limit Exceeded

Solution code:
a, b, k = map(int, input().split())
for _ in range(k):
    if a >= 1:
        a -= 1
    elif b >= 1:
        b -= 1
print(a, b)

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
# 高橋A枚, 青木B枚, K回繰り返す

diffA = min(K, A)
A -= diffA
B -= min(B, K - diffA)

print(A, B)

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split())
taka=a-k
if taka < 0:
    aoki = b-abs(taka)
    taka = 0
    if aoki < 0:
        aoki = 0
else:
    aoki=b
print(taka,aoki)

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())

aa = max (a - k, 0)
rest = max(k - a, 0)
bb = max (b - rest, 0)
print(f'{aa} {bb}')

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
if a >= k:
    print(a - k, b)
elif a + b >= k:
    print(0, a+b-k)
else:
    print(0, 0)

Submission status: Accepted

Solution code:
a,b,k = map(int,input().split())
if a+b <= k:
  print(0,0)
elif a >= k:
  print(a-k,b)
else:
  print(0,b-k+a)

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
n = min(a,k)
k -= n
print(a-n, max(0,b-k))

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split())
if a>=k:
    print(a-k,b)
else:
    print(0,max(b+a-k,0))

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split())
if a<k:
    b-=k-a
    a=0
    if b<0:
        b=0
else:
    a-=k
print(a,b)

Submission status: Accepted

Solution code:
A,B,K=map(int,input().split())

if K<A:
    ans1=A-K
    ans2=B
else:
    ans1=0
    ans2=max(A+B-K,0)

print(ans1,ans2)

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split())
if a<k:
    b-=k-a
    a=0
    if b<0:
        b=0
else:
    if a-k>0:
        a-=k
    else:
        a=0
print(a,b)

Submission status: Accepted

Solution code:
a,b,k=(int(x) for x in input().split())
c=a

if a+b<=k:
    a=0
    b=0
elif a<=k:
    a=0
    b=b+c-k
elif a>k:
    a=a-k

c=str(a)+" "+str(b)
print(c)

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
a = a - k
if a < 0:
    b += a
    a = 0
    if b < 0:
        b = 0
print(str(a) + ' ' + str(b))

Submission status: Accepted

Solution code:
a,b,k=[int(i) for i in input().split()]
if(k>a):
    k=k-a
    a=0
elif(k<=a):
    a=a-k
    k=0
if(k>b):
    k=k-b
    b=0
elif(k<=b):
    b=b-k
    k=0
print(a,b)

Submission status: Accepted

Solution code:
a,b,k = map(int,input().split())
if k < a:
    a -= k
elif k < a + b:
    b = b - k + a
    a = 0
else:
    a = 0
    b = 0
print(a,b)

Submission status: Accepted

Solution code:
A, B, K = map(int,input().split())

if K <= A:
    print(A-K, B)
elif K <= A+B:
    print(0, B-(K-A))
else:
    print(0,0)

Submission status: Accepted

Solution code:
a, b, k = map( int, input().split() )

if a + b < k:
    print( "0 0" )
elif a < k:
    print( "0 " + str( a + b - k ) )
else:
    print( str( a - k ) + " " + str( b ) )

Submission status: Accepted

Solution code:
A,B,K = list(map(int, input().split()))
if A > K:
    A -= K
else:
    K -= A
    A = 0
    
    if B > K:
        B -= K
    else:
        B = 0
print(A,B)

A -= min(A, K)

Submission status: Accepted

Solution code:
import numpy as np

A,B,K=map(int,input().split())

if K>A:
    a=0
    B=max(B-(K-A),0)
else:
    a=A-K

print(a, B)

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())

rem_a = max(a - k, 0)
k = max(k - a, 0)
rem_b = max(b - k, 0)

print(str(rem_a) + ' ' + str(rem_b))

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())

if A >= K:
  print(A-K, B)
elif B >= K-A:
  K -= A
  print(0, B-K)
else:
  print(0, 0)

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
if k <= a:
	print(a - k, b)
elif k <= a + b:
	print(0, a + b - k)
else:
	print(0, 0)

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())

total = a+b
if total <= k:
    ans = [0, 0]
else:
    if a <= k:
        k -= a
        a = 0
        b -= k
        ans = [a, b]
    else:
        a -= k
        ans = [a, b]

print(*ans)

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())

if K < A:
    A = A-K
elif A <= K and K - A < B:
    B = B - (K - A)
    A = 0
else:
    A = 0
    B = 0

print(A, B)

Submission status: Accepted

Solution code:
A,B,K=map(int,input().split())
a=max(A-K,0)
k=K-(A-a)
b=max(B-k,0)
print(a,b)

Submission status: Accepted

Solution code:
A,B,K=map(int,input().split())
if A >= K:
    A = A-K
else:
    if B>= K-A:
        B = B-(K-A)
    else:
        B = 0
    A = 0
print(A,B)

Submission status: Accepted

Solution code:
a,b,k = map(int,input().split())
if k >= a:
    k -= a
    a = 0
    b -= k
else:
    a -= k
print(a,max(0,b))

Submission status: Accepted

Solution code:
a, b, k = [int(i) for i in input().split()]
if a <= k:
  b = b - k + a if b - k + a >= 0 else 0
  a = 0
else:
  a -= k
print(a, b)

Submission status: Accepted

Solution code:
n,m,k = map(int,input().split())
if n >= k:
    print(n-k,m)
else:
    if m - (k-n) < 0:
        m = 0
    else:
        m -= k - n
    print(0,m)

Submission status: Accepted

Solution code:
#!/usr/bin/env python


def solve(A: int, B: int, K: int):
    if A >= K:
        return f"{A-K} {B}"
    elif A + B >= K:
        return f"0 {A+B-K}"
    else:
        return "0 0"


def main():
    A, B, K = map(int, input().split())
    answer = solve(A, B, K)
    print(answer)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
A,B,K=map(int, input().split())

if A>=K:
	print(A-K, B)

else:
	if A+B>=K:
		print(0,B-(K-A))
	else:
		print(0,0)

Submission status: Accepted

Solution code:
A,B,K = map(int,input().split())

A,rem = max(A-K,0),max(K-A,0)
B = max(B-rem,0)

print(A,B)

Submission status: Accepted

Solution code:
a,b,k = map(int,input().split())

if a >= k :
  print(a-k,b)
  
elif a + b >= k:
  print(0,b-k+a)

else:
  print(0,0)

Submission status: Accepted

Solution code:
a,b,k = map(int, input().split(" "))
if a < k:
  k -= a
  a = 0
  if b < k:
    b = 0
  else:
    b -= k
else:
  a -= k
print(a,b)

Submission status: Accepted

Solution code:
A,B,K =map(int,input().split())
if A >= K:
    a = A-K
    b = B
else:
    a = 0
    b = max(0,B+A-K)
print(a,b)

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split())
if a>=k: print(a-k,b)
elif a+b>=k: print(0,a+b-k)
else: print(0,0)

Submission status: Accepted

Solution code:
a,b,k = [int(x) for x in input().split()]
if a > k:
  print(a-k,b)
else:
  print(0,max(0,a+b-k))

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
if a < k and k <= a + b:
    k = k - a
    a = 0
    b = b - k
elif a + b < k:
    a = 0
    b= 0
else:
    a = a - k

print(a , b)

Submission status: Accepted

Solution code:
def main():
    A, B, K = map(int, input().split())

    if A - K > 0:
        print(A - K, B)
    elif B + A - K > 0:
        print(0, B + A - K)
    else:
        print(0, 0)


main()

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())

if A+B <= K:
    print(0, 0)
elif A <= K:
    print(0, B- (K-A))
else:
    print(A-K, B)