#include<bits/stdc++.h>
using namespace std;
#define mst(x,y) memset(x,y,sizeof(x))
#define rep(x,y,z) for(int x=(y);(x)<(z);x++)
#define fi first
#define se second
#define mk(x,y) make_pair(x,y)
#define pii pair<int,string>
#define piii pair<int,pii>
const int maxn=1e5+10;
int n,a[maxn];
int main(){
cin>>n;
rep(i,1,n+1) cin>>a[i];
sort(a+1,a+1+n);
if(n&1) cout<<1<<" ";
else cout<<0<<" ";
rep(i,1,n+1) a[i]+=a[i-1];
cout<<a[n]-2*a[n/2]<<"\n";
return 0;
}