Problem Statement :

Solve the Mystery. :)

Input

First line of input contains T – No of test cases.(1 ≤ T ≤ 21)
Next T lines of input contains three integers a,b,c separated by spaces.
(1 ≤ a,b ≤ 20) (1 ≤ c ≤ 100)

Output

T lines should contain a single integer.

SAMPLE INPUT
3
2 3 2
13 14 1
14 5 9

SAMPLE OUTPUT
5
14
464
T = input()

for t in xrange(T):
	a,b,c = map(int, raw_input().split())
	fibo = [a,b]
	if c == 0:
		print a
	elif c == 1:
		print b
	else:
		for i in range(2,c+1):
			fib = fibo[1] + fibo[0]
			fibo[0] = fibo[1]
			fibo[1] = fib
		print fibo[1]