import java.util.*;
import java.util.Arrays;
public class Main {
	private static Scanner sc;

	public static void main(String[] args) {
	   sc = new Scanner(System.in);
	   int a=sc.nextInt();
	   int []b=new int[a];
	   long d=0;
	   for(int i=0;i<a;i++){
		   b[i]=sc.nextInt();
	   }
	   Arrays.sort(b);
	   for(int i=0;i<a;i++){
		  d+=b[i]; 
	   }
	   System.out.println(b[0]+" "+b[a-1]+" "+d);
	}

	

} import java.util.*; util.* java import java.util.Arrays; Arrays java.util public class Main {
	private static Scanner sc;

	public static void main(String[] args) {
	   sc = new Scanner(System.in);
	   int a=sc.nextInt();
	   int []b=new int[a];
	   long d=0;
	   for(int i=0;i<a;i++){
		   b[i]=sc.nextInt();
	   }
	   Arrays.sort(b);
	   for(int i=0;i<a;i++){
		  d+=b[i]; 
	   }
	   System.out.println(b[0]+" "+b[a-1]+" "+d);
	}

	

} Main private static Scanner sc; sc public static void main(String[] args) {
	   sc = new Scanner(System.in);
	   int a=sc.nextInt();
	   int []b=new int[a];
	   long d=0;
	   for(int i=0;i<a;i++){
		   b[i]=sc.nextInt();
	   }
	   Arrays.sort(b);
	   for(int i=0;i<a;i++){
		  d+=b[i]; 
	   }
	   System.out.println(b[0]+" "+b[a-1]+" "+d);
	} main {
	   sc = new Scanner(System.in);
	   int a=sc.nextInt();
	   int []b=new int[a];
	   long d=0;
	   for(int i=0;i<a;i++){
		   b[i]=sc.nextInt();
	   }
	   Arrays.sort(b);
	   for(int i=0;i<a;i++){
		  d+=b[i]; 
	   }
	   System.out.println(b[0]+" "+b[a-1]+" "+d);
	} sc = new Scanner(System.in) sc new Scanner(System.in) int a=sc.nextInt(); a sc.nextInt() sc.nextInt sc int []b=new int[a]; b new int[a] a long d=0; d 0 for(int i=0;i<a;i++){
		   b[i]=sc.nextInt();
	   } int i=0; int i=0; i 0 i<a i a i++ i++ i {
		   b[i]=sc.nextInt();
	   } {
		   b[i]=sc.nextInt();
	   } b[i]=sc.nextInt() b[i] b i sc.nextInt() sc.nextInt sc Arrays.sort(b) Arrays.sort Arrays b for(int i=0;i<a;i++){
		  d+=b[i]; 
	   } int i=0; int i=0; i 0 i<a i a i++ i++ i {
		  d+=b[i]; 
	   } {
		  d+=b[i]; 
	   } d+=b[i] d b[i] b i System.out.println(b[0]+" "+b[a-1]+" "+d) System.out.println System.out System System.out b[0]+" "+b[a-1]+" "+d " " b[a-1] b[0]+" "+b[a-1]+" "+d b[0] b 0 " " b[a-1] b a-1 a 1 " " d String[] args args public class Main {
	private static Scanner sc;

	public static void main(String[] args) {
	   sc = new Scanner(System.in);
	   int a=sc.nextInt();
	   int []b=new int[a];
	   long d=0;
	   for(int i=0;i<a;i++){
		   b[i]=sc.nextInt();
	   }
	   Arrays.sort(b);
	   for(int i=0;i<a;i++){
		  d+=b[i]; 
	   }
	   System.out.println(b[0]+" "+b[a-1]+" "+d);
	}

	

} public class Main {
	private static Scanner sc;

	public static void main(String[] args) {
	   sc = new Scanner(System.in);
	   int a=sc.nextInt();
	   int []b=new int[a];
	   long d=0;
	   for(int i=0;i<a;i++){
		   b[i]=sc.nextInt();
	   }
	   Arrays.sort(b);
	   for(int i=0;i<a;i++){
		  d+=b[i]; 
	   }
	   System.out.println(b[0]+" "+b[a-1]+" "+d);
	}

	

} Main
import java.util.*;
import java.util.Arrays;
public class Main {
	private static Scanner sc;

	public static void main(String[] args) {
	   sc = new Scanner(System.in);
	   int a=sc.nextInt();
	   int []b=new int[a];
	   long d=0;
	   for(int i=0;i<a;i++){
		   b[i]=sc.nextInt();
	   }
	   Arrays.sort(b);
	   for(int i=0;i<a;i++){
		  d+=b[i]; 
	   }
	   System.out.println(b[0]+" "+b[a-1]+" "+d);
	}

	

}