var x = require('fs').readFileSync('/dev/stdin', 'utf8');
var lines = x.split(/\n/);
var n = Number(lines[0]);
var arr = lines[1].split(/\s/).map(Number);
min = arr[0]; max = arr[0]; sum = arr[0];
for (var i=1; i < n ; i++){
  if (min > arr[i]) min = arr[i];
  if (max < arr[i]) max = arr[i];
  sum += arr[i];
};
console.log(min +" "+ max +" "+ sum);

