#include<bits/stdc++.h>
using namespace std;

int main(){
  long long n, a[10000];
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> a[i];
  }
  cout << *min_element( a, a + n) << " "
       << *max_element( a, a + n) << " "
       << accumulate( a, a + n, 0LL) << endl;
}
#include<iostream>
using namespace std;	

int main(){
	int n;
	int ai, min, max;
	long long sum = 0;
	cin >> n;
	
	min = 1000000;
	max = -1000000;
	while (n--){
		cin >> ai;
		sum += ai;
		if (max < ai) max = ai;
		if (min > ai) min = ai;
	}
	cout << min << " " << max << " " << sum << endl;

	return 0;
}