#include <bits/stdc++.h>
using namespace std;

int main() {
  int a,s,f =1000000, g = -1000000;
  long long d = 0;
  cin >> a;
  for(int i = 0; i < a;i++){
      cin >> s;
      if (s < f) f = s;
      if (s > g) g = s;
      d += s;
  }
  cout << f << " " << g << " " << d << endl;
}
