function main(input) {
  var temp = input.split('\n');
  var n = temp[0];
  var arr = temp[1].split(' ').map(Number);
  var max = Math.max.apply(null, arr);
  var min = Math.min.apply(null, arr);
  var sum = 0;
  for (var i = 0; i < n; i++)
    sum += arr[i]
  console.log(min+' '+max+' '+sum);
}

var x = require('fs').readFileSync('/dev/stdin', 'utf-8');
main(x);
