Sequence Simplification#10231

Sequence Simplification

1 second
64 megabytes
Hard

Help Alice simplify a sequence of fractional numbers. You are given real numbers. The task involves performing a series of steps where, in each step, a new sequence is created. Each number in this new sequence is the absolute difference between two consecutive numbers from the previous sequence. These steps are repeated until only one number remains. Your goal is to determine the final number after all the steps have been completed.

Input

The first line contains an integer – the number of numbers (1 < N \leq 1000). The second line contains the fractional numbers C_i, where 1 \leq i \leq N.

Output

Print the final number obtained after executing the described process.

Examples

Example 1

Loading
Loading

Note

step

step

step

step