1792: 【CSP数组】求和▅

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:6 Solved:6

Description

输入 lns="http://www.w3.org/1998/Math/MathML">n  lns="http://www.w3.org/1998/Math/MathML">1n5000 )个正整数,每个数都在 lns="http://www.w3.org/1998/Math/MathML">1  lns="http://www.w3.org/1998/Math/MathML">20000 之间;要求对这 lns="http://www.w3.org/1998/Math/MathML">n 个数中的奇数和偶数分别求和。

Input

第一行,一个正整数 lns="http://www.w3.org/1998/Math/MathML">n ( lns="http://www.w3.org/1998/Math/MathML">1n5000 )。

第 lns="http://www.w3.org/1998/Math/MathML">2n+1 行,每行一个正整数,每个数都在 lns="http://www.w3.org/1998/Math/MathML">120000 之间。

Output

输出文件共有二行,每行包含一个整数,第一行为所有奇数之和,第二行为所有偶数之和。

Sample Input Copy

5
3
10
7
5
8

Sample Output Copy

15
18