#include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;
const int N = 1E5 + 10;
int a[N];
int main(){
int n; cin >> n;
for(int i = 0; i < n; i ++ ) scanf("%d", &a[i]);
sort(a, a + n);
typedef long long ll;
ll res = 0;
for(int i = n / 2; i < n; i ++ ) res += a[i];
for(int i = 0; i < n / 2; i ++ ) res -= a[i];
if(n % 2 == 0) cout << '0';
else cout << '1';
cout << ' ' << res << endl;
return 0;
}