import java.util.*;
import java.io.*;
import java.lang.*;
import java.math.*;
public class Main{
	public static void main(String[] args) throws IOException{
		Scanner stdIn=new Scanner(System.in);
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int n,max=-1000001,min=1000001;
		long sum=0;
		n=stdIn.nextInt();
		for(int i=0;i<n;i++){
			int a=stdIn.nextInt();
			if(a>max)
				max=a;
			if(a<min)
				min=a;
			sum+=a;
		}
		System.out.println(min+" "+max+" "+sum);
	}
} import java.util.*; util.* java import java.io.*; io.* java import java.lang.*; lang.* java import java.math.*; math.* java public class Main{
	public static void main(String[] args) throws IOException{
		Scanner stdIn=new Scanner(System.in);
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int n,max=-1000001,min=1000001;
		long sum=0;
		n=stdIn.nextInt();
		for(int i=0;i<n;i++){
			int a=stdIn.nextInt();
			if(a>max)
				max=a;
			if(a<min)
				min=a;
			sum+=a;
		}
		System.out.println(min+" "+max+" "+sum);
	}
} Main public static void main(String[] args) throws IOException{
		Scanner stdIn=new Scanner(System.in);
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int n,max=-1000001,min=1000001;
		long sum=0;
		n=stdIn.nextInt();
		for(int i=0;i<n;i++){
			int a=stdIn.nextInt();
			if(a>max)
				max=a;
			if(a<min)
				min=a;
			sum+=a;
		}
		System.out.println(min+" "+max+" "+sum);
	} main {
		Scanner stdIn=new Scanner(System.in);
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int n,max=-1000001,min=1000001;
		long sum=0;
		n=stdIn.nextInt();
		for(int i=0;i<n;i++){
			int a=stdIn.nextInt();
			if(a>max)
				max=a;
			if(a<min)
				min=a;
			sum+=a;
		}
		System.out.println(min+" "+max+" "+sum);
	} Scanner stdIn=new Scanner(System.in); stdIn new Scanner(System.in) BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n n max=-1000001 max -1000001 1000001 min=1000001; min 1000001 long sum=0; sum 0 n=stdIn.nextInt() n stdIn.nextInt() stdIn.nextInt stdIn for(int i=0;i<n;i++){
			int a=stdIn.nextInt();
			if(a>max)
				max=a;
			if(a<min)
				min=a;
			sum+=a;
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			int a=stdIn.nextInt();
			if(a>max)
				max=a;
			if(a<min)
				min=a;
			sum+=a;
		} {
			int a=stdIn.nextInt();
			if(a>max)
				max=a;
			if(a<min)
				min=a;
			sum+=a;
		} int a=stdIn.nextInt(); a stdIn.nextInt() stdIn.nextInt stdIn if(a>max)
				max=a; a>max a max max=a max a if(a<min)
				min=a; a<min a min min=a min a sum+=a sum a System.out.println(min+" "+max+" "+sum) System.out.println System.out System System.out min+" "+max+" "+sum " " max min+" "+max+" "+sum min " " max " " sum String[] args args public class Main{
	public static void main(String[] args) throws IOException{
		Scanner stdIn=new Scanner(System.in);
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int n,max=-1000001,min=1000001;
		long sum=0;
		n=stdIn.nextInt();
		for(int i=0;i<n;i++){
			int a=stdIn.nextInt();
			if(a>max)
				max=a;
			if(a<min)
				min=a;
			sum+=a;
		}
		System.out.println(min+" "+max+" "+sum);
	}
} public class Main{
	public static void main(String[] args) throws IOException{
		Scanner stdIn=new Scanner(System.in);
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int n,max=-1000001,min=1000001;
		long sum=0;
		n=stdIn.nextInt();
		for(int i=0;i<n;i++){
			int a=stdIn.nextInt();
			if(a>max)
				max=a;
			if(a<min)
				min=a;
			sum+=a;
		}
		System.out.println(min+" "+max+" "+sum);
	}
} Main
import java.util.*;
import java.io.*;
import java.lang.*;
import java.math.*;
public class Main{
	public static void main(String[] args) throws IOException{
		Scanner stdIn=new Scanner(System.in);
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int n,max=-1000001,min=1000001;
		long sum=0;
		n=stdIn.nextInt();
		for(int i=0;i<n;i++){
			int a=stdIn.nextInt();
			if(a>max)
				max=a;
			if(a<min)
				min=a;
			sum+=a;
		}
		System.out.println(min+" "+max+" "+sum);
	}
}