A sequence is an arithmetic sequence if every two successive number has same difference. Suppose this is a sequence of numbers:
a1, a2, a3, …, an
This is an arithmetic sequence if ai−ai+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 n-th term. Otherwise you must print “Error”.
Input
In the first line there will be an integer T (1≤T≤2000) denoting number of test cases. Each of the case will contain 4 integers a1, a2, a3 (−300≤a1,a2,a3≤300) and n (1≤n≤1000).
Output
In each line specify the case number and print the answer.