#include<iostream>
#include<algorithm>
using namespace std;
const int N = 1e5 + 10;
int a[N];
int main()
{
int n;
cin.tie(0);
cout.tie(0);
ios :: sync_with_stdio(false);
cin >> n;
for(int i = 1; i <= n; i++) cin >> a[i];
sort(a + 1, a + 1 + n);
int s1 = 0, s2 = 0;
for(int i = 1; i <= n; i++)
{
if(i <= n / 2) s1 += a[i];
else s2 += a[i];
}
cout << n % 2 << " " << s2 - s1;
return 0;
}