#include<iostream>
using namespace std;

int main(){
int n, x, i, max = -1000000, min =1000000;
long sum = 0;

cin >> n;

for( i = 0; i < n; i++ ){
 cin >> x;
 sum = sum + x;
 if ( x > max ) max = x;
 if ( x < min ) min = x; 
}
cout << min << " " << max << " " << sum << endl;
return 0;
}