#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,v,i,hi,lo;
  long sum;
  cin>>n;
  cin>>v;
  hi=lo=sum=v;
  for(i=1;i<n;i++){
    cin>>v;
    if(lo>v)lo=v;
    else if(hi<v)hi=v;
    sum+=v;
  }
  cout<<lo<<" "<<hi<<" "<<sum<<endl;
}
