#include<iostream>

using namespace std;


int main(){

	int n;
	cin >> n;

	int a,max=-1000000,min=1000000;
	long int sum=0;

	for(int i=0;i<n;i++){
		cin >> a;
		sum += a;
		if(max < a) max = a;
		if(min > a) min = a;
	}
	cout << min << " " << max << " " << sum << "\n";

	return 0;
}


