#include <iostream>
const int NUM = 10000;
const int INF = 1 << 20;

using namespace std;

int main() {
    long long i, a[NUM];
    long long max = -INF, min = INF, sum = 0;
    cin >> i;
    i = 0;
    while (cin >> a[i]) {
        if (max < a[i]) max = a[i];
        if (min > a[i]) min = a[i];
        sum += a[i++];
    }
    cout << min << ' ' << max << ' ' << sum << endl;
    return 0;
}

#include<iostream>
#include<cmath>
#include<string>
#include<cctype>
#include<vector>
#include<numeric>
#include<algorithm>
using namespace std;
int main(){
        int n;
        cin>>n;
        vector<long>ar(n);
        for(auto&e:ar){
                scanf("%ld",&e);
        }
        long long sum1=0;
        for(int i=0;i<n;i++){
                sum1+=ar[i];
        }
    sort(ar.begin(),ar.end());
    printf("%ld %ld %lld\n",ar[0],ar[n-1],sum1);
        return 0;
}