#include <iostream>
using namespace std;

int main(int argc,char *argv[]){
	int count;
	long int max,min,sum = 0;
	long int n;
	cin >> count;
	if (count--){
		cin >> n;
		sum += n;
		max = n;
		min = n;	
	} 
	while(count--){
		cin >> n;
		sum += n;
		if (max < n) {
			max = n;
		}
		if (min > n) {
			min = n;
		}	
	}
	cout << min << " " << max << " " << sum << "\n";
	return 0;
}

