import java.io.IOException;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws IOException {
		Scanner sc=new Scanner(System.in);
		
		int a;
		int min=1000000;
		int max=-1000000;
		long sum=0;
		int f=sc.nextInt();
		for(;sc.hasNext();){
			a=sc.nextInt();
			sum+=a;
			if(a<=min)min=a;
			if(a>=max)max=a;
			
		}
		System.out.printf("%d %d %d%n",min,max,sum);
		
	}
} import java.io.IOException; IOException java.io import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws IOException {
		Scanner sc=new Scanner(System.in);
		
		int a;
		int min=1000000;
		int max=-1000000;
		long sum=0;
		int f=sc.nextInt();
		for(;sc.hasNext();){
			a=sc.nextInt();
			sum+=a;
			if(a<=min)min=a;
			if(a>=max)max=a;
			
		}
		System.out.printf("%d %d %d%n",min,max,sum);
		
	}
} Main public static void main(String[] args) throws IOException {
		Scanner sc=new Scanner(System.in);
		
		int a;
		int min=1000000;
		int max=-1000000;
		long sum=0;
		int f=sc.nextInt();
		for(;sc.hasNext();){
			a=sc.nextInt();
			sum+=a;
			if(a<=min)min=a;
			if(a>=max)max=a;
			
		}
		System.out.printf("%d %d %d%n",min,max,sum);
		
	} main {
		Scanner sc=new Scanner(System.in);
		
		int a;
		int min=1000000;
		int max=-1000000;
		long sum=0;
		int f=sc.nextInt();
		for(;sc.hasNext();){
			a=sc.nextInt();
			sum+=a;
			if(a<=min)min=a;
			if(a>=max)max=a;
			
		}
		System.out.printf("%d %d %d%n",min,max,sum);
		
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int a; a int min=1000000; min 1000000 int max=-1000000; max -1000000 1000000 long sum=0; sum 0 int f=sc.nextInt(); f sc.nextInt() sc.nextInt sc for(;sc.hasNext();){
			a=sc.nextInt();
			sum+=a;
			if(a<=min)min=a;
			if(a>=max)max=a;
			
		} ; sc.hasNext() sc.hasNext sc {
			a=sc.nextInt();
			sum+=a;
			if(a<=min)min=a;
			if(a>=max)max=a;
			
		} {
			a=sc.nextInt();
			sum+=a;
			if(a<=min)min=a;
			if(a>=max)max=a;
			
		} a=sc.nextInt() a sc.nextInt() sc.nextInt sc sum+=a sum a if(a<=min)min=a; a<=min a min min=a min a if(a>=max)max=a; a>=max a max max=a max a System.out.printf("%d %d %d%n",min,max,sum) System.out.printf System.out System System.out "%d %d %d%n" min max sum String[] args args public class Main {
	public static void main(String[] args) throws IOException {
		Scanner sc=new Scanner(System.in);
		
		int a;
		int min=1000000;
		int max=-1000000;
		long sum=0;
		int f=sc.nextInt();
		for(;sc.hasNext();){
			a=sc.nextInt();
			sum+=a;
			if(a<=min)min=a;
			if(a>=max)max=a;
			
		}
		System.out.printf("%d %d %d%n",min,max,sum);
		
	}
} public class Main {
	public static void main(String[] args) throws IOException {
		Scanner sc=new Scanner(System.in);
		
		int a;
		int min=1000000;
		int max=-1000000;
		long sum=0;
		int f=sc.nextInt();
		for(;sc.hasNext();){
			a=sc.nextInt();
			sum+=a;
			if(a<=min)min=a;
			if(a>=max)max=a;
			
		}
		System.out.printf("%d %d %d%n",min,max,sum);
		
	}
} Main
import java.io.IOException;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws IOException {
		Scanner sc=new Scanner(System.in);
		
		int a;
		int min=1000000;
		int max=-1000000;
		long sum=0;
		int f=sc.nextInt();
		for(;sc.hasNext();){
			a=sc.nextInt();
			sum+=a;
			if(a<=min)min=a;
			if(a>=max)max=a;
			
		}
		System.out.printf("%d %d %d%n",min,max,sum);
		
	}
}