#include<iostream>
#include<algorithm>
using namespace std;

int main(){
    int N;
    cin>>N;
    long arr[N];
    long sum=0;
    for(int i=0;i<N;++i){
        cin>>arr[i];
        sum+=arr[i];
    }
    sort(arr,arr+N);
    cout<<arr[0]<<" "<<arr[N-1]<<" "<<sum<<endl;
}
