#include <iostream>

using namespace std;

int main(){
int N, m, M, t;
	long int s; 
	cin >> N;
	m = 1000000;
	M = -1000000;
	s = 0;
	for(int i = 0; i < N; i++){
		cin >> t;
		m = min(m,t);
		M = max(M,t);
		s += t;
	}
	cout << m << " " << M << " " << s << endl;
    return 0;
}
