Statement
There are problems arranged in nondecreasing order of difficulty. Solving problem takes units of time, and
holds.
tourist and rainboy both start solving problems at time . Each person solves only one problem at a time and takes no breaks between problems. The completion time of a problem is the total elapsed time from the start until that problem is solved. A person's penalty is the sum of the completion times of all problems.
tourist solves the problems in the order . rainboy solves them in the order . Both solve all problems.
Find rainboy's penalty minus tourist's penalty.
Input
The input is given from Standard Input in the following format:
Each case is given in the following format:
Output
For each test case, print rainboy's penalty minus tourist's penalty on one line.
Constraints
- .
- .
- ().
- ().
- The sum of over all test cases does not exceed .