#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
int main()
{
int n;
cin >> n;
vector<int> v(n);
for(int i = 0; i < n; i++){
cin >> v[i];
}
sort(v.begin(), v.end());
long sum1 = 0, sum2 = 0, tn = n / 2;;
for(int i = 0; i < n; i++){
if(i < tn) sum1 += v[i];
else sum2 += v[i];
}
if(n % 2 == 0) cout << 0 << " ";
else cout << 1 << " ";
cout << abs(sum1 - sum2) << endl;
return 0;
}