#include <bits/stdc++.h>
int main(void) {
  int n;
  int i;
  int a[10000];
  int max;
  int min;
  long int totall = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  max = min = a[0];
  for (i = 0; i < n; i++) {
    if (max < a[i]) {
      max = a[i];
    }
    if (min > a[i]) {
      min = a[i];
    }
    totall = totall + a[i];
  }
  printf("%d %d %d\n", min, max, totall);
  return 0;
}
