import sys input = lambda: sys.stdin.readline().rstrip() # ----------------------- # def main(): a, b, c, K = map(int, input().split()) for _ in range(K): a, b, c = (b+c)//2, (c+a)//2, (a+b)//2 print(a, b, c) if a == b == c: break return a + b + c t = int(input()) for _ in range(t): print(main())