# Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

## An Arithmetic Problem

Limits: 1s, 512 MB

A sequence is an arithmetic sequence if every two successive number has same difference. Suppose this is a sequence of numbers:

a_{1}, a_{2}, a_{3},………………..a_{n}

This is an arithmetic sequence if a_{i}-a_{i+1} is same for each i from 1 to n-1.

You are given first 3 terms of a sequence and the value of n. If it is an arithmetic sequence you must print the nth term. Otherwise you must print “Error”.

#### Input

In First line there will be an integer T denoting number of test cases. Each of the case will contain 4 integers a_{1}, a_{2}, a_{3} and n.

Constraints:

- 1 ≤ T ≤ 100
- -300 ≤ a
_{1}, a_{2}, a_{3}≤ 300 - 1 ≤ n ≤ 1000

#### Output

In each line specify the case number and print the answer.

#### Samples

Input | Output |
---|---|

3 1 2 3 10 1 4 3 10 15 30 45 5 | Case 1: 10 Case 2: Error Case 3: 75 |