const input = require('fs').readFileSync('/dev/stdin', 'utf8');
const lines = input.trim().split('\n');
const target = lines[1].split(' ');
const min = target.reduce((a,b)=> Number(a)<Number(b)?a:b);
const max = target.reduce((a,b)=>Number(a)>Number(b)?a:b);
let sum = 0;

target.forEach(function(val){
  sum += Number(val);
});

console.log(min + ' ' + max + ' ' + sum);
