You are a close friend of Dr. G, a bioinformatics scientist working at Phitron. Dr. G is studying the evolution of a synthetic genome in a controlled laboratory environment. Each genome is represented by a non-negative integer, where each bit in its binary representation corresponds to the presence or absence of a specific genetic marker.
The genome evolves over discrete time steps according to the following rules:
Dr. G has been manually checking whether the genome sequences evolve correctly, but this task has become extremely tedious and time-consuming. To help your friend, you decide to write a program that determines the genome value at a given time step $$$t$$$.
The first line contains an integer $$$T$$$ ($$$1 \le T \le 10^5$$$), the number of independent experiments.
Each of the next $$$T$$$ lines contains three integers $$$a$$$, $$$b$$$, and $$$t$$$ ($$$0 \le a, b \le 10^6$$$, $$$1 \le t \le 10^{8}$$$), where:
For each experiment, output a single integer — the genome value at time step $$$t$$$.
3 11 13 1 11 13 2 11 13 3
11 13 9
In this example, the initial genome values are $$$a = 11$$$ and $$$b = 13$$$.
The binary representations of the initial genomes are:
| Name |
|---|


