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);
		}
		



		} 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);
		}
		



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



		} 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);
		}
		



		} Main
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);
		}
		



		}