import java.util.Scanner;


public class Main {


  public static void main(String[] args) {

	  Scanner sc=new Scanner(System.in);
	 int n=Integer.parseInt(sc.next());
	 int a[]=new int[n+1];
	 int min=0,max=0;
	 long sum=0;

	 for(int i=0;i<n;i++){
		 a[i]=Integer.parseInt(sc.next());
		 if(i==0){
			 min=a[i];
			 max=a[i];
			
		 }
		
		 sum=sum+a[i];
		 min=Math.min(min, a[i]);
		 max=Math.max(a[i], max);
		 
		 
	 }

	 System.out.println(min + " " + max + " "+ sum);

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


  public static void main(String[] args) {

	  Scanner sc=new Scanner(System.in);
	 int n=Integer.parseInt(sc.next());
	 int a[]=new int[n+1];
	 int min=0,max=0;
	 long sum=0;

	 for(int i=0;i<n;i++){
		 a[i]=Integer.parseInt(sc.next());
		 if(i==0){
			 min=a[i];
			 max=a[i];
			
		 }
		
		 sum=sum+a[i];
		 min=Math.min(min, a[i]);
		 max=Math.max(a[i], max);
		 
		 
	 }

	 System.out.println(min + " " + max + " "+ sum);

  }
} Main public static void main(String[] args) {

	  Scanner sc=new Scanner(System.in);
	 int n=Integer.parseInt(sc.next());
	 int a[]=new int[n+1];
	 int min=0,max=0;
	 long sum=0;

	 for(int i=0;i<n;i++){
		 a[i]=Integer.parseInt(sc.next());
		 if(i==0){
			 min=a[i];
			 max=a[i];
			
		 }
		
		 sum=sum+a[i];
		 min=Math.min(min, a[i]);
		 max=Math.max(a[i], max);
		 
		 
	 }

	 System.out.println(min + " " + max + " "+ sum);

  } main {

	  Scanner sc=new Scanner(System.in);
	 int n=Integer.parseInt(sc.next());
	 int a[]=new int[n+1];
	 int min=0,max=0;
	 long sum=0;

	 for(int i=0;i<n;i++){
		 a[i]=Integer.parseInt(sc.next());
		 if(i==0){
			 min=a[i];
			 max=a[i];
			
		 }
		
		 sum=sum+a[i];
		 min=Math.min(min, a[i]);
		 max=Math.max(a[i], max);
		 
		 
	 }

	 System.out.println(min + " " + max + " "+ sum);

  } Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int n=Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int a[]=new int[n+1]; a new int[n+1] n+1 n 1 int min=0 min 0 max=0; max 0 long sum=0; sum 0 for(int i=0;i<n;i++){
		 a[i]=Integer.parseInt(sc.next());
		 if(i==0){
			 min=a[i];
			 max=a[i];
			
		 }
		
		 sum=sum+a[i];
		 min=Math.min(min, a[i]);
		 max=Math.max(a[i], max);
		 
		 
	 } int i=0; int i=0; i 0 i<n i n i++ i++ i {
		 a[i]=Integer.parseInt(sc.next());
		 if(i==0){
			 min=a[i];
			 max=a[i];
			
		 }
		
		 sum=sum+a[i];
		 min=Math.min(min, a[i]);
		 max=Math.max(a[i], max);
		 
		 
	 } {
		 a[i]=Integer.parseInt(sc.next());
		 if(i==0){
			 min=a[i];
			 max=a[i];
			
		 }
		
		 sum=sum+a[i];
		 min=Math.min(min, a[i]);
		 max=Math.max(a[i], max);
		 
		 
	 } a[i]=Integer.parseInt(sc.next()) a[i] a i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc if(i==0){
			 min=a[i];
			 max=a[i];
			
		 } i==0 i 0 {
			 min=a[i];
			 max=a[i];
			
		 } min=a[i] min a[i] a i max=a[i] max a[i] a i sum=sum+a[i] sum sum+a[i] sum a[i] a i min=Math.min(min, a[i]) min Math.min(min, a[i]) Math.min Math min a[i] a i max=Math.max(a[i], max) max Math.max(a[i], max) Math.max Math a[i] a i max 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) {

	  Scanner sc=new Scanner(System.in);
	 int n=Integer.parseInt(sc.next());
	 int a[]=new int[n+1];
	 int min=0,max=0;
	 long sum=0;

	 for(int i=0;i<n;i++){
		 a[i]=Integer.parseInt(sc.next());
		 if(i==0){
			 min=a[i];
			 max=a[i];
			
		 }
		
		 sum=sum+a[i];
		 min=Math.min(min, a[i]);
		 max=Math.max(a[i], max);
		 
		 
	 }

	 System.out.println(min + " " + max + " "+ sum);

  }
} public class Main {


  public static void main(String[] args) {

	  Scanner sc=new Scanner(System.in);
	 int n=Integer.parseInt(sc.next());
	 int a[]=new int[n+1];
	 int min=0,max=0;
	 long sum=0;

	 for(int i=0;i<n;i++){
		 a[i]=Integer.parseInt(sc.next());
		 if(i==0){
			 min=a[i];
			 max=a[i];
			
		 }
		
		 sum=sum+a[i];
		 min=Math.min(min, a[i]);
		 max=Math.max(a[i], max);
		 
		 
	 }

	 System.out.println(min + " " + max + " "+ sum);

  }
} Main
import java.util.Scanner;


public class Main {


  public static void main(String[] args) {

	  Scanner sc=new Scanner(System.in);
	 int n=Integer.parseInt(sc.next());
	 int a[]=new int[n+1];
	 int min=0,max=0;
	 long sum=0;

	 for(int i=0;i<n;i++){
		 a[i]=Integer.parseInt(sc.next());
		 if(i==0){
			 min=a[i];
			 max=a[i];
			
		 }
		
		 sum=sum+a[i];
		 min=Math.min(min, a[i]);
		 max=Math.max(a[i], max);
		 
		 
	 }

	 System.out.println(min + " " + max + " "+ sum);

  }
}