অন্তহীন ছুটে চলা, অবিরাম জীবনের অর্থ খুজে ফেরা

The Next Number

General Statement:
A relatively simple task for humans to do is to identify the next number in an arithmetic sequence of numbers. For example, given the sequence of numbers 3, 6, and 9, we know that the next number in the sequence is 12 since each number is followed by a number increasing it by 3. Alternatively, given the sequence of numbers 3, 6, and 12, we know that the next number in the sequence is 24 since each number is followed by a number that doubles it.

Your task is to write a program that will deduce the next integer in a given sequence of three integers where the same arithmetic operation is applied to each integer to produce the next. The only arithmetic operations that will be used are addition, subtraction, multiplication, or division.

Input: The first line of the input contains an integer n that represents the number of data collections that follow where each data collection is on a single line. Each input line contains three integers with each pair of integers separated by a single space. The integers represent a sequence as described in the General Statement.

Output: Your program should produce n lines of output (one for each data collection). The output for each data collection should be the next integer in the corresponding input sequence.

The output is to be formatted exactly like that for the sample output given below.

Assumptions: The value of n will be between 1 and 100, inclusive.
There will be exactly one answer to each input sequence.
The answer will always be an integer (even if division is used).