#include<iostream>
#include<iomanip>
using namespace std;

int main()
{
	double a;
	double n;
	double max,min,sum;

	cin>>n;	
	sum=0;
	max=-1000000;
	min=1000000;
	for( int i=0; i<n; i++ ) {
		cin>>a;
		sum+=a;
		if( max < a ) {
			max=a;
		}
		if( a < min ) {
			min=a;
		}
	}
	
	cout <<setprecision(12)<<min<<" "<<max<<" "<<sum<<endl;  
    return 0;
}
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <functional>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cctype>

#define rep(i, a) REP(i, 0, a)
#define REP(i, a, b) for(int i = a; i < b; ++i)

typedef long long ll;
typedef unsigned long long ull;
typedef std::pair<int, int> P;
typedef std::pair<P, int> PP;
const double esp = 1e-9;
const int infi = (int)1e+9 + 10;
const ll infll = (ll)1e+17 + 10;

int n;
int a[10001];

int main(){
	std::cin >> n;
	rep(i, n)std::cin >> a[i];
	std::cout << *std::min_element(a, a + n) << " " << *std::max_element(a, a + n) << " " << std::accumulate(a, a + n, 0ll) << std::endl;
	return 0;
}