The input contains a series of numbers that is either an arithmetic progression (等差數列) or a geometric progression (等比數列). You task is to distinguish which progression it is from the first four numbers and calculate the fifth number, and also print the common difference (公差) or the common ratio (公比).
For example, if the input is 1 3 5 7, then you know this is an arithmetic progression. The next number is 9 and the common difference is 2. So the output should be 9 2 .
There are NO progression like 1 1 1 1 or 2 2 2 2 which are both an arithmetic progression and a geometric progression.
Note that input and the output are all integers.
Four integers
The next number of the progression and the corresponding common difference or common ratio. The two numbers should be separated by a blank.
You DO NOT need to print ‘\n’ at the end of the output.