#include <iostream>
using namespace std;
typedef  long long ll;
int main(){
  ll n,x,ans,max,min;
  cin>>n>>x;
  max=min=ans=x;
  for(int i=1;i<n;i++){
    cin>>x;
    ans+=x;
    if(max<x) max=x;
    if(min>x) min=x;
  }
  cout<<min<<" "<<max<<" "<<ans<<"\n";
}