let inputs = require('fs').readFileSync('/dev/stdin', 'UTF-8').split('\n');
const num = inputs[0];
const nums = inputs[1].split(' ').map(Number);
const min = nums.reduce((a,b) => Math.min(a,b));
const max = nums.reduce((a,b) => Math.max(a,b));
const sum = nums.reduce((a,b) => a+b);
console.log(min + ' ' + max+ ' ' + sum);
