public class Main {


		public static void main(String[] args) {
		java.util.Scanner scan = new java.util.Scanner(System.in);
		int a, b, c, d, e;
		long f;
		a = scan.nextInt();
		d = -1000000;
		e = 1000000;
		f = 0;
		if(0 <= a && a <= 10000){
		for(b = 1; b <= a ; b++){
		
			c = scan.nextInt();
		 if(-1000000<=c && c <= 1000000){
			
			if(c >= d){
				d = c;
			}
			if(c <= e){
				e = c;
			}
			f += c;
		}
	
		}
		}
		
		System.out.print(e+" ");
		System.out.print(d+" ");
		System.out.println(f);
		}
		



		}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz