function Main(input) {
  const args = input.trim().split("\n");
  let n = parseInt(args[0]);
  let a = args[1].split(" ").map((x) => Number(x));

  let sum = 0;
  for (let i = 0; i < n; i++) {
    sum += a[i];
  }
  console.log(Math.min(...a) + " " + Math.max(...a) + " " + sum);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
