AT_past19_b 入金と出金

Description

Takahashi made $ (N - 1) $ transactions at a bank. The transactions are described by integers $ A_1, A_2, \ldots, A_N $ . The $ i $ -th transaction is a deposit of $ (A_{i + 1} - A_i) $ yen if $ A_i < A_{i + 1} $ , and a withdrawal of $ (A_i - A_{i + 1}) $ yen if $ A_i > A_{i + 1} $ . (Yen is a currency of Japan.) Here, it is guaranteed that the given input satisfies $ A_i \neq A_{i + 1} $ . Find the total amounts of money deposited and withdrawn through these transactions.

Input Format

The input is given from Standard Input in the following format: > $ N $ $ A_1 $ $ A_2 $ $ \ldots $ $ A_N $

Output Format

If a total of $ X $ yen was deposited and $ Y $ yen was withdrawn through the transactions, print $ X $ and $ Y $ in this order, separated by a space.

Explanation/Hint

### Sample Explanation 1 - The $ 1 $ -st transaction is a $ 9 - 2 = 7 $ yen deposit, as $ 2 < 9 $ . - The $ 2 $ -st transaction is a $ 9 - 5 = 4 $ yen withdrawal, as $ 9 > 5 $ . - The $ 3 $ -st transaction is a $ 8 - 5 = 3 $ yen deposit, as $ 5 < 8 $ . Thus, a total of $ 10 $ yen was deposited, and $ 4 $ yen was withdrawn. ### Constraints - $ 2 \leq N \leq 100 $ - $ 0 \leq A_i \leq 10^7 $ - $ A_i \neq A_{i + 1} $ - All input values are integers.