#include <iostream>
#include <algorithm>
#include <numeric>
const int NUM = 10000;

using namespace std;

int main() {
    int n, a[NUM];
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    cout << *min_element(a, a + n) << " "
         << *max_element(a, a + n) << " "
         << accumulate(a, a + n, 0LL) << endl;
    return 0;
}

#include<iostream>
#include<cstdio>
using namespace std;
int main(){
	long long Min,Max,sum=0,n,m;
	scanf("%lld%lld",&n,&Max);
	Min=sum=Max;
	for(int i=1;i<n;i++){
		scanf("%lld",&m);
		if(m>Max) Max=m;
		if(m<Min) Min=m;
		sum+=m;
	}
	printf("%lld %lld %lld\n",Min,Max,sum);
	return 0;
}
