var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr = input.split("\n");
var arr = (Arr[1]).split(" ").map(Number);
var min = arr.reduce(function(a, b){ return Math.min(a,b); } );
var max = arr.reduce(function(a, b){ return Math.max(a,b); } );
var sum = arr.reduce(function(a, b){ return a+b; } );
console.log(min + " " + max + " " + sum);
