qyliang/CodeNanoFix huggingface dataset:
Buggy code:
a=input().split()
t=int(a[0])
b= int(a[1])
for i in range(a[2]):
    if t%2==0:
        t=t-(t/2)
        b=b+(t/2)
    else:
        t-=1
    if b%2==0:
        b=b-(b/2)
        t=t+(b/2)
print(str(t)+" "+ str(b))

Fixed code:
p = input()
a = int(p.split()[0])
b = int(p.split()[1])
k = int(p.split()[2])
for i in range(k):
    if i % 2 == 0:
        if a % 2 == 1:
            a -= 1
        a /= 2
        b += a
    else:
        if b % 2 == 1:
            b -= 1
        b /= 2
        a += b 
print(str(int(a)) + " " + str(int(b)))
Buggy code:
def abk(x,y):
  if x%2==1:
    x = x-1
  y = y + x/2
  x = x/2
  return (x,y)

a,b,k = map(int, input().split())
for _ in range(k):
  if _%2==0:
    a,b = abk(a,b)
  else:
    b,a = abk(b,a)
    
print(a,b)

Fixed code:
def abk(x,y):
  if x%2==1:
    x = x-1
  y = y + x/2
  x = x/2
  return (x,y)

a,b,k = map(int, input().split())
for _ in range(k):
  if _%2==0:
    a,b = abk(a,b)
  else:
    b,a = abk(b,a)
    
a = int(a)
b = int(b)
print(a,b)
Buggy code:
s = input().split()
a_have = int(s[0])
b_have = int(s[1])
for  i in range(int(s[2])):
    if i % 2 == 0:
        if a_have % 2 != 0:
            a_have-=1
        b_have+= a_have/2
        a_have = a_have/2
    else :
        if b_have % 2 != 0:
            b_have-=1
        a_have+= b_have/2
        b_have = b_have/2
print(a_have,b_have)


Fixed code:
s = input().split()
a_have = int(s[0])
b_have = int(s[1])
for  i in range(int(s[2])):
    if i % 2 == 0:
        if a_have % 2 != 0:
            a_have-=1
        b_have+= a_have/2
        a_have = a_have/2
    else :
        if b_have % 2 != 0:
            b_have-=1
        a_have+= b_have/2
        b_have = b_have/2
print(int(a_have),int(b_have))
Buggy code:
A,B,K=map(int,input().split())
count=1
while count!=K:
         if  A%2!=0:
                 A-=1
         A,B=A/2,A/2+B
         count+=1
         A,B=B,A
if count%2==0:
           print(int(A),int(B))
else:
            print(int(B),int(A))

Fixed code:
A,B,K=map(int,input().split())
count=0
while count!=K:
         if  A%2!=0:
                 A-=1
         A,B=A/2,A/2+B
         count+=1
         A,B=B,A
if count%2==0:
           print(int(A),int(B))
else:
            print(int(B),int(A))
Buggy code:
a,b,k = map(int,input().split())
for i in range(k):
    if i % 2 == 1:
        if a %  2 == 1:
            a = (a - 1) // 2
            b += a
    else:
        if b % 2 == 1:
            b = (b - 1) // 2
            a += b
            
print(a,b)

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

for i in range(k):
  if i%2:
    a, b = a + b // 2, b // 2
  else:
    a, b = a // 2, a // 2 + b
print(a, b)
Buggy code:
import sys

def solve(A,B,K):
    ab = [A,B]
    for i in range(K):
        if ab[0]%2!=0:
            ab[0]-=1
        ab[1]+=ab[0]//2
        ab[0]-=ab[0]//2
        ab.reverse()
    if K%2!=0:
        return  ab[1],ab[0]
    return ab[0],ab[1]


def readQuestion():
    ws = sys.stdin.readline().strip().split()
    A = int(ws[0])
    B = int(ws[1])
    C = int(ws[2])
    return (A, B, C)

def main():
    print(solve(*readQuestion()))

# Uncomment before submission
# main()

Fixed code:
import sys

def solve(A,B,K):
    ab = [A,B]
    for i in range(K):
        if ab[0]%2!=0:
            ab[0]-=1
        ab[1]+=ab[0]//2
        ab[0]-=ab[0]//2
        ab.reverse()
    if K%2!=0:
        print(ab[1],ab[0])
        return
    print(ab[0],ab[1])


def readQuestion():
    ws = sys.stdin.readline().strip().split()
    A = int(ws[0])
    B = int(ws[1])
    C = int(ws[2])
    return (A, B, C)

def main():
    solve(*readQuestion())
    

# Uncomment before submission
main()
Buggy code:
a,b,k = map(int, input().split())

for i in range(k):
  if a%2==1:
    a-=1
  a-=a//2
  b+=a//2

  if b%2==1:
    b-=1
  b-=b//2
  a+=b//2
print(a,b)


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

for i in range(k//2):
    a = a//2*2
    b+= a/2
    a/=2
    b= b//2*2
    a+= b/2
    b/=2
if(k%2==1):
    a = a//2*2
    b+= a/2
    a/=2

print(int(a),int(b))
Buggy code:
A, B, K = input().split()

A = int(A)
B = int(B)
K = int(K)

for i in K:
	if i % 2 == 0:
		B += A /2
		A /= 2
	else:
		A += B / 2
		B /= 2
print(A + " " + B)

Fixed code:
A, B, K = input().split()

A = int(A)
B = int(B)
K = int(K)

for i in range(K):
	if i % 2 == 0:
		A //= 2
		B += A 
	else:
		B //= 2
		A += B 
print(str(A) + " " + str(B))
Buggy code:
*AB, K = map(int, input().split())
turn = 0
for _ in range(K):
    AB[turn] //= 2
    AB[turn ^ 1] += AB[turn]
print(*AB)

Fixed code:
*AB, K = map(int, input().split())
turn = 0
for _ in range(K):
    AB[turn] -= AB[turn] % 2
    AB[turn ^ 1] += AB[turn] // 2
    AB[turn] //= 2
    turn ^= 1
print(*AB)
Buggy code:
list_num = [int(i) for i in input().split()]

players = list_num[0:1]
k = list_num[-1]

for i in range(k):
    players[i%2] = int(players[i%2]/2)
    players[(i+1)%2] += players[i%2]

for i in range(2):
    print(players[i], end="")

print("")

Fixed code:
list_num = [int(i) for i in input().split()]

players = list_num[0:2]
k = list_num[-1]

for i in range(k):
    players[i%2] = players[i%2]//2
    players[(i+1)%2] += players[i%2]

print(players[0], players[1])
Buggy code:
A,B,K=map(int,input().split())
if K%2==0:
	K=K/2
	for i in range(K):
		if A%2==0:
			A=A/2
			B=B+A
			if B%2==0:
				B= B/2
				A=A+B
				
			else:
				B=(B-1)/2
				A=A+B
				
		else:
			A= (A-1)/2
			B=A+B
			if B%2==0:
				B= B/2
				A=A+B
				
			else:
				B=(B-1)/2
				A=A+B
				
else:
	K=(K-1)/2
	for i in range(int(K)):
		if A%2==0:
			A=A/2
			B=B+A
			if B%2==0:
				B= B/2
				A=A+B
				
			else:
				B=(B-1)/2
				A=A+B
				
		else:
			A= (A-1)/2
			B=A+B
			if B%2==0:
				B= B/2
				A=A+B
				
			else:
				B=(B-1)/2
				A=A+B
	
	if A%2==0:
		A=A/2
		B=B+A
	else:
		A=(A-1)/2
		B=A+B
	
print(str(int(A))+" "+str(int(B)))

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

if K%2==0:
    for _ in range(int(K/2)):
        if A%2==0:
            A=A/2
            B=B+A
        else:
            A=A-1
            A=A/2
            B=B+A
        if B%2==0:
            B=B/2
            A=A+B
        else:
            B=B-1
            B=B/2
            A=A+B

else:
    for _ in range(int((K-1)/2)):
        if A%2==0:
            A=A/2
            B=B+A
        else:
            A=A-1
            A=A/2
            B=B+A
        if B%2==0:
            B=B/2
            A=A+B
        else:
            B=B-1
            B=B/2
            A=A+B
    if A%2==0:
            A=A/2
            B=B+A
    else:
        A=A-1
        A=A/2
        B=B+A

print(str(int(A))+" "+str(int(B)))
Buggy code:
a, b, k = map(int, input().split(' '))
for i in range(k):
    if i%2 == 1:
        if a%2 == 1:
            a = (a-1)
        a = int(a/2)
        b += a
    else:
        if b%2 == 1:
            b -= 1
        b = int(b/2)
        a += b
print(str(b) + " " + str(a))
    


Fixed code:
a, b ,k = map(int,input().split())
turn = True
for i in range(k):
    if turn :
        if a % 2 == 1:
            b = b + (a - 1) / 2
            a = (a - 1) / 2
        else :
            b = b + a /2
            a = a / 2
    else :
        if b % 2 == 1:
            a = a + (b - 1) / 2
            b = (b - 1) / 2
        else :
            a = a + b /2
            b = b / 2
    turn = not turn
print(str(int(a)) +" " + str(int(b)))
Buggy code:
#encoding utf-8

a,b,k = map(int, input().split())
print(a,b,k)

for i in range(k):
    if i%2 == 0:
        if a%2 == 1:
            a -= 1
        b += int(a/2)
        a = int(a/2)
    # turn b
    else:
        if b%2 == 1:
            b -= 1
        a += int(b/2)
        b = int(b/2)



print(a,b)

Fixed code:
#encoding utf-8

a,b,k = map(int, input().split())
# print(a,b,k)

for i in range(k):
    if i%2 == 0:
        if a%2 == 1:
            a -= 1
        b += int(a/2)
        a = int(a/2)
    # turn b
    else:
        if b%2 == 1:
            b -= 1
        a += int(b/2)
        b = int(b/2)



print(a,b)
Buggy code:
A,B,K = map(int(),input().rstrip().split())

for i in range(K):
  if i % 2 == 0:
    B = B + A/2
    A = A/2
   else:
    A = A + B/2
    B=B/2

print (A,B)

Fixed code:
(A,B,K) = map(int,input().split())
for i in range(K):
    if i % 2:
        B = B //2
        A = A + B

    else:
        A = A // 2
        B = B + A
print(A,B)
Buggy code:
a, b, k = map(int,input().split())
cnt = 0
while True:
    if cnt==k:
        break
    if a%2!=0:
        a-=1
    b+=a/2
    a = a/2
    cnt+=1
    if cnt==k:
        break
    if b%2!=0:
        b-=1
    a+=b/2
    b = b/2
    cnt+=1


Fixed code:
a, b, k = map(int,input().split())
cnt = 0
while True:
    if cnt==k:
        break
    if a%2!=0:
        a-=1
    b+=a/2
    a = a/2
    cnt+=1
    if cnt==k:
        break
    if b%2!=0:
        b-=1
    a+=b/2
    b = b/2
    cnt+=1

print(int(a),int(b))
Buggy code:
a, b, k = map(int, input().split())
if k%2 == 0:
    for _ in range(int(k/2)):
        a = int(a/2)
        b += a
        b = int(b/2)
        a += b
    print(a ,b)
    
else:
    for _ in range((k-1/2)):
        a = int(a/2)
        b += a
        b = int(b/2)
        a += b
    a = int(a/2)
    b += a
    print(int(a),int(b))

Fixed code:
a, b, k = map(int, input().split())
if k%2 == 0:
    for _ in range(int(k/2)):
        a = int(a/2)
        b += a
        b = int(b/2)
        a += b
    print(a ,b)
    
else:
    for _ in range(int(k/2)):
        a = int(a/2)
        b += a
        b = int(b/2)
        a += b
    a = int(a/2)
    b += a
    print(int(a),int(b))
Buggy code:
A, B, K = map(int, input().split())
while K:
  if K % 2 == 1:
    if A % 2 == 0:
      A = A // 2
      B += A // 2
    else:
      A = (A - 1) // 2
      B += (A - 1) // 2
  else:
    if B % 2 == 0:
      A += B // 2
      B = B // 2
    else:
      A += (B - 1) // 2
      B = (B - 1) // 2
  K -= 1
print(A, B)


Fixed code:
A,B,K=map(int,input().split())
k=K//2
if K%2==0:
    while k>0:
        B=A//2+B 
        A=A//2
        A=B//2+A
        B=B//2
        k-=1
else:
    while k>0:
        B=A//2+B 
        A=A//2
        A=B//2+A
        B=B//2
        k-=1
    B=A//2+B 
    A=A//2
print(A,B)
Buggy code:
a,b,k=map(int,input().split())
count=0
while count<k:
    if a%2==1:
        a-=1
    b+=a//2
    a=a//2
    count+=1
    if b%2==1:
        b-=1
    a+=b//2
    b=b//2
    count+=1
print(a,b)

Fixed code:
a,b,k=map(int,input().split())
i = 0
while i < k:
  if i%2 == 0:
    if a%2 == 1:
      a += -1
    b += a//2
    a += -a//2
  if i%2 == 1:
    if b%2 == 1:
      b += -1
    a += b//2
    b += -b//2
  i += 1
print(a,b)
Buggy code:
%%time
# B
a,b,k = list(map(int, input().split()))

def eat(a,b):
    a-= a%2
    b=int(b+a/2)
    a= int(a/2)
    return a,b

for i in range(k):
    if i%2==0:
        a,b = eat(a,b)
    else:
        b,a = eat(b,a)
print(a,b)

Fixed code:
# B
a,b,k = list(map(int, input().split()))

def eat(a,b):
    a-= a%2
    b=int(b+a/2)
    a= int(a/2)
    return a,b

for i in range(k):
    if i%2==0:
        a,b = eat(a,b)
    else:
        b,a = eat(b,a)
print(a,b)
Buggy code:
a, b, c = input().split()

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

for i in range(c):
    if (a%2 == 1):
        a = a-1
    if (b%2 == 1):
        b = b - 1
    ac = a
    bc = b
    if(i%2 == 0):
        a = a/2 
        b = b + ac/2
    else:
        a = a+bc/2
        b = b/2 

print(int(a), int(b))




Fixed code:

a, b, c = input().split()

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

for i in range(c):
    if (a%2 == 1 and i %2 == 0):
        a = a - 1
    if (b%2 == 1 and i % 2 == 1):
        b = b - 1
    if(i%2 == 0):
        ac = a
        a = a/2 
        b = b + ac/2
    else:
        bc = b
        a = a+bc/2
        b = b/2 

print(int(a), int(b))
Buggy code:
A,B,K = map(int,input().split())
c = 0
if K%2 == 0:
  while c <= K:
    B = B+A//2
    A = A//2
    c += 1
    A = A+B//2
    B = B//2
    c += 1
else:
  while c < K-1:
    B = B+A//2
    A = A//2
    c += 1
    A = A+B//2
    B = B//2
    c += 1
  B = B+A//2
  A = A//2
print(A,B)

Fixed code:
A, B, K = map(int,input().split(" "))
c = 1

while c <= K:
    if A % 2 == 1:
        A -= 1
    A //= 2
    B += A
    a = A
    A = B
    B = a
    c += 1

if K % 2 == 0:
    print(A, B)

else:
    print(B, A)
Buggy code:
A, B, K= map(int, input().split())


for i in range(int(K)):
	if A % 2 != 0 :	
		A += -1
	B += A/2
	A -= A/2
	if B % 2 != 0 :	
		B+= -1
	A += B/2
	B -= B/2
print(int(A) , int(B))

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

for i in range(K):
    A = (A - (A % 2)) // 2
    B = B + A
    A, B = B, A

if K % 2 != 0:
    print(B, A)
    exit()
print(A, B)
Buggy code:
A, B, K = map(int, input().split())

while True:
    if K == 0:
        break
    else:        
        if A%2 !=0:
            A -= 1
        B += A//2
        A = A//2
        print(A,B)
        K -= 1

    if K == 0:
        break
    else:       
        if B%2 !=0:
            B -= 1
        A += B//2
        B = B//2
        print(A,B)
        K -= 1
    
print(A,B)

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

while True:
    if K == 0:
        break
    else:        
        if A%2 !=0:
            A -= 1
        B += A//2
        A = A//2
        K -= 1

    if K == 0:
        break
    else:       
        if B%2 !=0:
            B -= 1
        A += B//2
        B = B//2
        K -= 1
    
print(A,B)
Buggy code:
#coding:utf-8

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

is_odd = K % 2

for k in range(K):
    if k % 2 == is_odd:
        if A % 2 == 1:
            A -= 1
        B = B + A * 0.5
        A = A * 0.5

    else:
        if B % 2 == 1:
            B -= 1
        A = A + B * 0.5
        B = B * 0.5

print(int(A), int(B))


Fixed code:
#coding:utf-8

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

flag = K % 2

for k in range(K):
    if k % 2 == 0:
        if A % 2 == 1:
            A -= 1
        B = B + A * 0.5
        A = A * 0.5

    else:
        if B % 2 == 1:
            B -= 1
        A = A + B * 0.5
        B = B * 0.5

print(int(A), int(B))
Buggy code:
a = list(map(int,input().split()))

A = a[0]; B = a[1]; K = a[2]

for i in range(K):
    if i % 2 == 0:
        if A % 2 == 1:
            A -= 1
        cokkie = A / 2
        A -= cokkie
        B += cokkie
    else:
        if B % 2 == 1:
            B -= 1
        cokkie = B / 2
        B -= cokkie
        A += cokkie

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

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

A = a[0]; B = a[1]; K = a[2]

for i in range(K):
    if i % 2 == 0:
        if A % 2 == 1:
            A -= 1
        cokkie = A / 2
        A -= cokkie
        B += cokkie
    else:
        if B % 2 == 1:
            B -= 1
        cokkie = B / 2
        B -= cokkie
        A += cokkie

print(str(int(A)) + " " + str(int(B)))
Buggy code:
a, b, k = [int(i) for i in input().split(" ")]

for i in range(k):
  if a % 2 == 1:
    a -= 1

  b += (a / 2)
  a = a / 2

  if b % 2 == 1:
    b -= 1

  a += (b / 2)
  b = b / 2

print("{} {}".format(int(a), int(b)))

Fixed code:
a, b, k = [int(i) for i in input().split(" ")]

for i in range(int(k / 2)):
  if a % 2 == 1:
    a -= 1

  b += (a / 2)
  a = a / 2

  if b % 2 == 1:
    b -= 1

  a += (b / 2)
  b = b / 2

if k % 2 == 1:
    if a % 2 == 1:
        a -= 1

    b += (a / 2)
    a = a / 2

print("{} {}".format(int(a), int(b)))
Buggy code:
a, b, c = (int(i) for i in input().split()) 
for i in range(c)
 if(i%2==0):
  a=a//2
  b=b+a//2
 else:
  b=b//2
  a=a+b//2
print(a,b)

   

Fixed code:
a,b,k=map(int,input().split())
for i in range(0,k):
    if i%2==0:
        c=a//2
        a=c
        b=c+b
    else:
        c=b//2
        b=c
        a=a+c
print(a,b)
Buggy code:
A,B,K = map(int,input().split())

countK = 0
while(countK<K):
    if countK%2 == 0:
        if A%2 == 1:
            A -= 1
            A = A//2
            B = B + A
        else:
            A = A//2
            B = B + A//2
    else:
        if B%2 == 1:
            B -= 1
            B = B//2
            A = A + B//2
        else:
            B = B//2
            A = A + B
    countK += 1
print("{} {}".format(A,B))


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

countK = 0
while(countK<K):
    if countK%2 == 0:
        if A%2 == 1:
            A -= 1
            A = A//2
            B = B + A
        else:
            A = A//2
            B = B + A
    else:
        if B%2 == 1:
            B -= 1
            B = B//2
            A = A + B
        else:
            B = B//2
            A = A + B
    countK += 1
print("{} {}".format(A,B))
Buggy code:
a,b,k=map(int,input().split())
i=0
while True:
  if a%2==1:
    a-=1
  b+=a//2
  a//=2
  i+=1
  if i==k:
    break
    
  if b%2==1:
    b=-1
  a+=b//2
  b//=2
  i+=1
  if i==k:
    break
    
print(a,b)

Fixed code:
a, b, k = list(map(int, input().split()))
i = 0
while(True):
    if i == k:
        break
    i += 1
    if a % 2 != 0:
        a -= 1
    b +=  a / 2
    a //= 2

    if i == k:
        break
    i += 1
    if b % 2 != 0:
        b -= 1
    a += b / 2
    b //= 2
print(int(a), int(b))
Buggy code:
a, b, k = map(int, input().split())
for i in range(k):
    if i%2 == 0:
        if a%2 == 0:
            a /= 2
            b += 2
        elif a%2 == 1:
            a -= 1
            a /= 2
            b += a
    elif i%2 == 1:
        if b%2 == 0:
            b /= 2
            a += b
        elif a%2 == 1:
            b -= 1
            b /= 2
            a += 2
    print(int(a),int(b))
print(int(a),int(b))


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

for i, j in enumerate(range(k)):
    if i % 2 == 0:
        if a % 2 == 1:
            a = a - 1
        b = b + a // 2
        a = a // 2
    elif i % 2 == 1:
        if b % 2 == 1:
            b = b - 1
        a = a + b // 2
        b = b // 2

print(a, b)
Buggy code:
A, B, K = map(int,input().split())
for i in range(K):
  if i % 2 == 0:
    if A % 2 == 1:
      A -= 1
    B += A // 2
  else:
    if B % 2 == 1:
      B -= 1
    A += B // 2
print(A,B)

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

for i in range(K):
    if i%2==0:
        if A%2==1:
            A -= 1
        n = int(A//2) 
        A -= n
        B += n
    else:
        if B%2==1:
            B -= 1
        n = int(B//2) 
        B -= n
        A += n
print(A, B)
Buggy code:
def present(n):
  if n%2 == 0:
    return n/2
  else:
    return (n-1)/2

s = input()
a, b, k = s.split()

for i in range(int(k)):
  if i % 2 == 0:
    a = present(a)
    b = b + a
  else:
    b = present(b)
    a = a + b

print("{} {}".format(a,b))

Fixed code:
def present(n):
  if n%2 == 0:
    return n/2
  else:
    return (n-1)/2

s = input()
a, b, k = s.split()
a = int(a)
b = int(b)
for i in range(int(k)):
  if i % 2 == 0:
    a = present(a)
    b = b + a
  else:
    b = present(b)
    a = a + b

print("{} {}".format(int(a),int(b)))
Buggy code:
A,B,K = map(int(),input().rstrip().split())

for i in range(K):
  
  i % 2 == 0:
    B = B + A/2
    A = A/2
   else:
    A = A + B/2
    B=B/2
print ('{} {}'.format(A,B))

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

for i in range(K):

    if i % 2 == 0:
        B += A // 2
        A = A // 2
    else:
        A += B // 2
        B = B // 2

print("{0} {1}".format(A, B))
Buggy code:
A, B, K = map(int, input().split(' '))

for i in range(K):
  if i % 2 == 0:
    a = b = 0
    if A % 2 == 1:
      A -= 1
    a = A // 2
    A -= a
    B += a

  else:
    if B % 2 == 1:
      B -= 1
    b = B // 2
    B -= b
    A += b

print(A, B)
print(A, B)

Fixed code:
A, B, K  = map(int, input().split())
a = A
b = B
for i in range(K):
    if i%2 == 0:
        if a % 2 == 1:
            a -= 1
        a //= 2
        b += a
    else:
        if b % 2 == 1:
            b -= 1
        b //= 2
        a += b
print(a, b)
Buggy code:
A,B,K=map(int,input().split())
for i in range(K):
    if i%2==0:
        if A%2==1:
            A-=1
        B+=int(A/2)
        A=int(A/2)
    else:
        if B%2==1:
            B-=1
        A+=int(B/2)
        B=int(B/2)
print(A+" "+B)

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

for i in range(K):
    if i%2 == 0:
        if A%2 == 1:
            A -= 1
            B += A // 2
            A = A // 2
        else:
            B += A // 2
            A = A // 2
    else:
        if B%2 == 1:
            B -= 1
            A += B // 2
            B = B //2
        else:
            A += B // 2
            B = B // 2
print(A,B)
Buggy code:
a,b,k = map(int,input().split())
flag = True
for _ in range(k):
    if flag:
        if a%2==1:
            a-=1
        a = a//2
        b += a
        flag=False
    else:
        if b%2==1:
            b-=1
        b = b//2
        a += b
        Flag=True
print(a,b)


Fixed code:
a,b,k = map(int,input().split())
flag = True
for _ in range(k):
  if flag:
    flag = False
    if a%2==0:
      b += int(a/2)
      a = int(a/2)
    else:
      b += int((a-1)/2)
      a = int((a-1)/2)
  else:
    flag = True
    if b%2==0:
      a += int(b/2)
      b = int(b/2)
    else:
      a += int((b-1)/2)
      b = int((b-1)/2)
print(a,b)
Buggy code:
A, B, K = map(int, input().split())
for k in range(K):
  if k % 2 == 0:
    if A % 2 == 1:
      A -= 1
    
    A //= 2
    B += A // 2
 
  else:
    if B % 2 == 1:
      B -= 1
    
    B //= 2
    A += B // 2

print(A, B)

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

for k in range(K):
  if k % 2 == 0:
    if A % 2 == 1:
      A = A - 1
    A = A // 2
    B = B + A
  else:
    if B % 2 == 1:
      B = B - 1
    B = B // 2
    A = A + B

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

for i in range(K):
    if A % 2 == 1:
        A -= 1
    A /= 2
    A, B = B + A, A

print(int(A), int(B))


Fixed code:
A, B, K = map(int, input().split())
for i in range(K):
  if i % 2 == 0:
    if A % 2 == 1:
      A -= 1
    A = A // 2
    B += A
  else:
    if  B % 2 == 1:
      B -= 1
    B = B // 2
    A += B
    
print(A, B)
Buggy code:
a,b,k=map(int,input().split())
t=True
for i in range(0,k):
    if t==True:
        a=a//2
        b+=a
    else:
        b=b//2
        a+=b
    t=not t

Fixed code:
a,b,k=map(int,input().split())
t=True
for i in range(0,k):
    if t==True:
        a=a//2
        b+=a
    else:
        b=b//2
        a+=b
    t=not t
print(a,b)
Buggy code:
A, B, K = map(int, input().strip().split())

for k in range(K):
  if k % 2 == 0:
    A = A // 2
    B = B + A // 2
  else:
    B = B // 2
    A = A + B // 2
    
print(A, B)

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

for k in range(K):
    if k%2 == 0:
        A = A - A%2
        A,B = A//2, B + A//2
    else:
        B = B - B%2
        A,B = A + B//2, B//2

print(A,B)
Buggy code:
a,b,k = map(int,input().split())
c = 0
while k>0:
    if c == 0:
        a -= a%2
        a,b = a//2,b+a//2
    else:
        b -= a%2
        b,a = b//2,a+b//2
    c = 1-c    
    k -= 1
print(a,b)

Fixed code:
a,b,k = map(int,input().split())
c = 0
while k>0:
    if c == 0:
        a,b = a//2,b+a//2
    else:
        b,a = b//2,a+b//2
    c = 1-c    
    k -= 1
print(a,b)
Buggy code:
a, b, k = map(int, input().split(' '))

for i in range(k):

    if i % 2 == 0:
        if a % 2 == 1:
            a -= 1
        
        tmp_a = int(a / 2)

        a = tmp_a
        b = b + tmp_a

    else:
        if b % 2 == 1:
            b -= 1
        
        tmp_b = int(b / 2)

        b = tmp_b
        a = a + tmp_b

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

for i in range(k):

    if i % 2 == 0:
        if a % 2 == 1:
            a -= 1
        
        tmp_a = int(a / 2)

        a = tmp_a
        b = b + tmp_a

    else:
        if b % 2 == 1:
            b -= 1
        
        tmp_b = int(b / 2)

        b = tmp_b
        a = a + tmp_b

print(a, b)
Buggy code:
a,b,k = map(int,input().split())
for i in range(k):
  if i%2 == 0:
    if a%2 != 0 :
      a -=1
    a /= 2
    b += a
  else :
    if b%2 != 0:
      b -= 1
    b /= 2
    a += b
print(a,b)

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

s=0

for i in range(k):
    if s%2==0:
        if a%2!=0:
            a-=1
        b+=a//2
        a//=2
    else:
        if b%2!=0:
            b-=1
        a+=b//2
        b//=2
    s+=1

print(a,end=' ')
print(b)