function Main(input) {
  input = input.split("\n");
  tmp = input[1].split(' ').map(Number);
  var min = 1000000;
  var max = -1000000;
  var sum = 0;
  for(var i = 0; i < input[0]; i++){
    if(tmp[i] < min) min = tmp[i];
    if(tmp[i] > max) max = tmp[i];
    sum += tmp[i];
  }
  console.log(min + ' ' + max + ' ' + sum);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

