import java.util.Arrays;
import java.util.Scanner;
public class Main{

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int[] ary=new int[n];
		for(int i=0; i<ary.length; i++) {
			ary[i]=sc.nextInt();
		}
		Arrays.sort(ary);
		long sum=0;
		for(int i=0; i<ary.length; i++) {
			sum+=ary[i];
		}
		System.out.printf("%d %d %d%n",ary[0],ary[n-1],sum);
	}
	
}
 import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main{

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int[] ary=new int[n];
		for(int i=0; i<ary.length; i++) {
			ary[i]=sc.nextInt();
		}
		Arrays.sort(ary);
		long sum=0;
		for(int i=0; i<ary.length; i++) {
			sum+=ary[i];
		}
		System.out.printf("%d %d %d%n",ary[0],ary[n-1],sum);
	}
	
} Main public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int[] ary=new int[n];
		for(int i=0; i<ary.length; i++) {
			ary[i]=sc.nextInt();
		}
		Arrays.sort(ary);
		long sum=0;
		for(int i=0; i<ary.length; i++) {
			sum+=ary[i];
		}
		System.out.printf("%d %d %d%n",ary[0],ary[n-1],sum);
	} main {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int[] ary=new int[n];
		for(int i=0; i<ary.length; i++) {
			ary[i]=sc.nextInt();
		}
		Arrays.sort(ary);
		long sum=0;
		for(int i=0; i<ary.length; i++) {
			sum+=ary[i];
		}
		System.out.printf("%d %d %d%n",ary[0],ary[n-1],sum);
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] ary=new int[n]; ary new int[n] n for(int i=0; i<ary.length; i++) {
			ary[i]=sc.nextInt();
		} int i=0; int i=0; i 0 i<ary.length i ary.length ary ary.length i++ i++ i {
			ary[i]=sc.nextInt();
		} {
			ary[i]=sc.nextInt();
		} ary[i]=sc.nextInt() ary[i] ary i sc.nextInt() sc.nextInt sc Arrays.sort(ary) Arrays.sort Arrays ary long sum=0; sum 0 for(int i=0; i<ary.length; i++) {
			sum+=ary[i];
		} int i=0; int i=0; i 0 i<ary.length i ary.length ary ary.length i++ i++ i {
			sum+=ary[i];
		} {
			sum+=ary[i];
		} sum+=ary[i] sum ary[i] ary i System.out.printf("%d %d %d%n",ary[0],ary[n-1],sum) System.out.printf System.out System System.out "%d %d %d%n" ary[0] ary 0 ary[n-1] ary n-1 n 1 sum String[] args args public class Main{

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int[] ary=new int[n];
		for(int i=0; i<ary.length; i++) {
			ary[i]=sc.nextInt();
		}
		Arrays.sort(ary);
		long sum=0;
		for(int i=0; i<ary.length; i++) {
			sum+=ary[i];
		}
		System.out.printf("%d %d %d%n",ary[0],ary[n-1],sum);
	}
	
} public class Main{

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int[] ary=new int[n];
		for(int i=0; i<ary.length; i++) {
			ary[i]=sc.nextInt();
		}
		Arrays.sort(ary);
		long sum=0;
		for(int i=0; i<ary.length; i++) {
			sum+=ary[i];
		}
		System.out.printf("%d %d %d%n",ary[0],ary[n-1],sum);
	}
	
} Main
import java.util.Arrays;
import java.util.Scanner;
public class Main{

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int[] ary=new int[n];
		for(int i=0; i<ary.length; i++) {
			ary[i]=sc.nextInt();
		}
		Arrays.sort(ary);
		long sum=0;
		for(int i=0; i<ary.length; i++) {
			sum+=ary[i];
		}
		System.out.printf("%d %d %d%n",ary[0],ary[n-1],sum);
	}
	
}

