#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <numeric>
using namespace std;

int main() {
  vector<int> result;
  string n;
  string input;

  getline(cin, n);
  getline(cin, input);
  istringstream iss(input);
  string num;

  while (getline(iss, num, ' ')) {
    result.push_back(stoi(num));
  }

  long long min = *min_element(result.begin(), result.end());
  long long max = *max_element(result.begin(), result.end());
  long long sum = accumulate(result.begin(), result.end(), 0LL);

  cout << min << " " << max << " " << sum << endl;
}

#include <iostream>

using namespace std;
int main(void){
    int max=-2147483648;
    int min=2147483647;
    long sum=0;
    
    int n,in;
    cin >> n;

    for (int i=0;i<n;i++){
        cin >> in;    
        if(min>in) min=in;
        
        if(max<in) max=in;

        sum = sum + in;
    }

    cout << min <<" "<< max <<" "<< sum << endl;            

    return 0;
}
