#!/usr/bin/env python3
# NOTE: it is recommended to use this even if you don't understand the following code.

import sys

# uncomment the two following lines if you want to read/write from files
# sys.stdin = open('input.txt')
# sys.stdout = open('output.txt', 'w')

T = int(input().strip())
for test in range(1, T+1):
    A, B, K = map(int, input().strip().split())

    G = 0


    # INSERT YOUR CODE HERE


    print(G)

sys.stdout.close()
