import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner( System.in );
		int count = sc.nextInt();
		
		int min		= 1000000;
		int max		= -1000000;
		long calc	= 0;
		
		for(int i = 0; i < count; i++) {
			int a = sc.nextInt();
			
			calc += a;
			
			if( a > max ) {
				max = a;
				
			}
			if ( a < min ) {
				min = a;
			}
				
		}
		System.out.println(min+" "+max+" "+calc);
		
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner( System.in );
		int count = sc.nextInt();
		
		int min		= 1000000;
		int max		= -1000000;
		long calc	= 0;
		
		for(int i = 0; i < count; i++) {
			int a = sc.nextInt();
			
			calc += a;
			
			if( a > max ) {
				max = a;
				
			}
			if ( a < min ) {
				min = a;
			}
				
		}
		System.out.println(min+" "+max+" "+calc);
		
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner( System.in );
		int count = sc.nextInt();
		
		int min		= 1000000;
		int max		= -1000000;
		long calc	= 0;
		
		for(int i = 0; i < count; i++) {
			int a = sc.nextInt();
			
			calc += a;
			
			if( a > max ) {
				max = a;
				
			}
			if ( a < min ) {
				min = a;
			}
				
		}
		System.out.println(min+" "+max+" "+calc);
		
	} main {
		Scanner sc = new Scanner( System.in );
		int count = sc.nextInt();
		
		int min		= 1000000;
		int max		= -1000000;
		long calc	= 0;
		
		for(int i = 0; i < count; i++) {
			int a = sc.nextInt();
			
			calc += a;
			
			if( a > max ) {
				max = a;
				
			}
			if ( a < min ) {
				min = a;
			}
				
		}
		System.out.println(min+" "+max+" "+calc);
		
	} Scanner sc = new Scanner( System.in ); sc new Scanner( System.in ) int count = sc.nextInt(); count sc.nextInt() sc.nextInt sc int min		= 1000000; min 1000000 int max		= -1000000; max -1000000 1000000 long calc	= 0; calc 0 for(int i = 0; i < count; i++) {
			int a = sc.nextInt();
			
			calc += a;
			
			if( a > max ) {
				max = a;
				
			}
			if ( a < min ) {
				min = a;
			}
				
		} int i = 0; int i = 0; i 0 i < count i count i++ i++ i {
			int a = sc.nextInt();
			
			calc += a;
			
			if( a > max ) {
				max = a;
				
			}
			if ( a < min ) {
				min = a;
			}
				
		} {
			int a = sc.nextInt();
			
			calc += a;
			
			if( a > max ) {
				max = a;
				
			}
			if ( a < min ) {
				min = a;
			}
				
		} int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc calc += a calc a if( a > max ) {
				max = a;
				
			} a > max a max {
				max = a;
				
			} max = a max a if ( a < min ) {
				min = a;
			} a < min a min {
				min = a;
			} min = a min a System.out.println(min+" "+max+" "+calc) System.out.println System.out System System.out min+" "+max+" "+calc " " max min+" "+max+" "+calc min " " max " " calc String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner( System.in );
		int count = sc.nextInt();
		
		int min		= 1000000;
		int max		= -1000000;
		long calc	= 0;
		
		for(int i = 0; i < count; i++) {
			int a = sc.nextInt();
			
			calc += a;
			
			if( a > max ) {
				max = a;
				
			}
			if ( a < min ) {
				min = a;
			}
				
		}
		System.out.println(min+" "+max+" "+calc);
		
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner( System.in );
		int count = sc.nextInt();
		
		int min		= 1000000;
		int max		= -1000000;
		long calc	= 0;
		
		for(int i = 0; i < count; i++) {
			int a = sc.nextInt();
			
			calc += a;
			
			if( a > max ) {
				max = a;
				
			}
			if ( a < min ) {
				min = a;
			}
				
		}
		System.out.println(min+" "+max+" "+calc);
		
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner( System.in );
		int count = sc.nextInt();
		
		int min		= 1000000;
		int max		= -1000000;
		long calc	= 0;
		
		for(int i = 0; i < count; i++) {
			int a = sc.nextInt();
			
			calc += a;
			
			if( a > max ) {
				max = a;
				
			}
			if ( a < min ) {
				min = a;
			}
				
		}
		System.out.println(min+" "+max+" "+calc);
		
	}
}