function Main(input){
	input=input.trim().split("\n");
	let N = input[0];
	let vec_a = input[1].split(" ").map(e => parseInt(e, 10));
	let mi = Math.min.apply(null,vec_a);
	let ma = Math.max.apply(null,vec_a);
	let sum = vec_a.reduce(function(a, x){return a + x;});
	console.log("%d %d %d",mi,ma,sum);	
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
