import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		int max, min;
		long sum = 0;
		
		int n = in.nextInt();
		int[] ary = new int[n];
		for(int i=0; i<n; i++){
			ary[i] = in.nextInt();
		}
		
		//?????§?????¨????°????????¨????
		max = min = ary[0];
		for(int i=1; i<n; i++){
			if(max<ary[i]){
				max = ary[i];
			}
			if(min>ary[i]){
				min = ary[i];
			}
		}
		//????¨????????¨????
		for(int i=0; i<n; i++){
			sum += ary[i];
		}
		System.out.println(min+" "+max+" "+sum);
		in.close();
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		int max, min;
		long sum = 0;
		
		int n = in.nextInt();
		int[] ary = new int[n];
		for(int i=0; i<n; i++){
			ary[i] = in.nextInt();
		}
		
		//?????§?????¨????°????????¨????
		max = min = ary[0];
		for(int i=1; i<n; i++){
			if(max<ary[i]){
				max = ary[i];
			}
			if(min>ary[i]){
				min = ary[i];
			}
		}
		//????¨????????¨????
		for(int i=0; i<n; i++){
			sum += ary[i];
		}
		System.out.println(min+" "+max+" "+sum);
		in.close();
	}
} Main public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		int max, min;
		long sum = 0;
		
		int n = in.nextInt();
		int[] ary = new int[n];
		for(int i=0; i<n; i++){
			ary[i] = in.nextInt();
		}
		
		//?????§?????¨????°????????¨????
		max = min = ary[0];
		for(int i=1; i<n; i++){
			if(max<ary[i]){
				max = ary[i];
			}
			if(min>ary[i]){
				min = ary[i];
			}
		}
		//????¨????????¨????
		for(int i=0; i<n; i++){
			sum += ary[i];
		}
		System.out.println(min+" "+max+" "+sum);
		in.close();
	} main {
		Scanner in = new Scanner(System.in);
		int max, min;
		long sum = 0;
		
		int n = in.nextInt();
		int[] ary = new int[n];
		for(int i=0; i<n; i++){
			ary[i] = in.nextInt();
		}
		
		//?????§?????¨????°????????¨????
		max = min = ary[0];
		for(int i=1; i<n; i++){
			if(max<ary[i]){
				max = ary[i];
			}
			if(min>ary[i]){
				min = ary[i];
			}
		}
		//????¨????????¨????
		for(int i=0; i<n; i++){
			sum += ary[i];
		}
		System.out.println(min+" "+max+" "+sum);
		in.close();
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) int max max min; min long sum = 0; sum 0 int n = in.nextInt(); n in.nextInt() in.nextInt in int[] ary = new int[n]; ary new int[n] n for(int i=0; i<n; i++){
			ary[i] = in.nextInt();
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			ary[i] = in.nextInt();
		} {
			ary[i] = in.nextInt();
		} ary[i] = in.nextInt() ary[i] ary i in.nextInt() in.nextInt in max = min = ary[0] max min = ary[0] min ary[0] ary 0 for(int i=1; i<n; i++){
			if(max<ary[i]){
				max = ary[i];
			}
			if(min>ary[i]){
				min = ary[i];
			}
		} int i=1; int i=1; i 1 i<n i n i++ i++ i {
			if(max<ary[i]){
				max = ary[i];
			}
			if(min>ary[i]){
				min = ary[i];
			}
		} {
			if(max<ary[i]){
				max = ary[i];
			}
			if(min>ary[i]){
				min = ary[i];
			}
		} if(max<ary[i]){
				max = ary[i];
			} max<ary[i] max ary[i] ary i {
				max = ary[i];
			} max = ary[i] max ary[i] ary i if(min>ary[i]){
				min = ary[i];
			} min>ary[i] min ary[i] ary i {
				min = ary[i];
			} min = ary[i] min ary[i] ary i for(int i=0; i<n; i++){
			sum += ary[i];
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			sum += ary[i];
		} {
			sum += ary[i];
		} sum += ary[i] sum ary[i] ary i System.out.println(min+" "+max+" "+sum) System.out.println System.out System System.out min+" "+max+" "+sum " " max min+" "+max+" "+sum min " " max " " sum in.close() in.close in String[] args args public class Main{
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		int max, min;
		long sum = 0;
		
		int n = in.nextInt();
		int[] ary = new int[n];
		for(int i=0; i<n; i++){
			ary[i] = in.nextInt();
		}
		
		//?????§?????¨????°????????¨????
		max = min = ary[0];
		for(int i=1; i<n; i++){
			if(max<ary[i]){
				max = ary[i];
			}
			if(min>ary[i]){
				min = ary[i];
			}
		}
		//????¨????????¨????
		for(int i=0; i<n; i++){
			sum += ary[i];
		}
		System.out.println(min+" "+max+" "+sum);
		in.close();
	}
} public class Main{
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		int max, min;
		long sum = 0;
		
		int n = in.nextInt();
		int[] ary = new int[n];
		for(int i=0; i<n; i++){
			ary[i] = in.nextInt();
		}
		
		//?????§?????¨????°????????¨????
		max = min = ary[0];
		for(int i=1; i<n; i++){
			if(max<ary[i]){
				max = ary[i];
			}
			if(min>ary[i]){
				min = ary[i];
			}
		}
		//????¨????????¨????
		for(int i=0; i<n; i++){
			sum += ary[i];
		}
		System.out.println(min+" "+max+" "+sum);
		in.close();
	}
} Main
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		int max, min;
		long sum = 0;
		
		int n = in.nextInt();
		int[] ary = new int[n];
		for(int i=0; i<n; i++){
			ary[i] = in.nextInt();
		}
		
		//?????§?????¨????°????????¨????
		max = min = ary[0];
		for(int i=1; i<n; i++){
			if(max<ary[i]){
				max = ary[i];
			}
			if(min>ary[i]){
				min = ary[i];
			}
		}
		//????¨????????¨????
		for(int i=0; i<n; i++){
			sum += ary[i];
		}
		System.out.println(min+" "+max+" "+sum);
		in.close();
	}
}