import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		
		int j = 0;
		int b = sc.nextInt();
		
		int min = b;
        int max = b;
        long sum = b;
        
		for(j=0;j<n-1;j++){
			int a = sc.nextInt();
			
			 sum =sum+a;
			 
		int i = 0;

		     min = Math.min(min,a);
		     max = Math.max(max,a);   	

		}
		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 = sc.nextInt();
		
		int j = 0;
		int b = sc.nextInt();
		
		int min = b;
        int max = b;
        long sum = b;
        
		for(j=0;j<n-1;j++){
			int a = sc.nextInt();
			
			 sum =sum+a;
			 
		int i = 0;

		     min = Math.min(min,a);
		     max = Math.max(max,a);   	

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

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		
		int j = 0;
		int b = sc.nextInt();
		
		int min = b;
        int max = b;
        long sum = b;
        
		for(j=0;j<n-1;j++){
			int a = sc.nextInt();
			
			 sum =sum+a;
			 
		int i = 0;

		     min = Math.min(min,a);
		     max = Math.max(max,a);   	

		}
		System.out.println(min + " " +max+ " " +sum);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		
		int j = 0;
		int b = sc.nextInt();
		
		int min = b;
        int max = b;
        long sum = b;
        
		for(j=0;j<n-1;j++){
			int a = sc.nextInt();
			
			 sum =sum+a;
			 
		int i = 0;

		     min = Math.min(min,a);
		     max = Math.max(max,a);   	

		}
		System.out.println(min + " " +max+ " " +sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int j = 0; j 0 int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int min = b; min b int max = b; max b long sum = b; sum b for(j=0;j<n-1;j++){
			int a = sc.nextInt();
			
			 sum =sum+a;
			 
		int i = 0;

		     min = Math.min(min,a);
		     max = Math.max(max,a);   	

		} j=0; j=0 j 0 j<n-1 j n-1 n 1 j++ j++ j {
			int a = sc.nextInt();
			
			 sum =sum+a;
			 
		int i = 0;

		     min = Math.min(min,a);
		     max = Math.max(max,a);   	

		} {
			int a = sc.nextInt();
			
			 sum =sum+a;
			 
		int i = 0;

		     min = Math.min(min,a);
		     max = Math.max(max,a);   	

		} int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc sum =sum+a sum sum+a sum a int i = 0; i 0 min = Math.min(min,a) min Math.min(min,a) Math.min Math min a max = Math.max(max,a) max Math.max(max,a) Math.max Math max 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) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		
		int j = 0;
		int b = sc.nextInt();
		
		int min = b;
        int max = b;
        long sum = b;
        
		for(j=0;j<n-1;j++){
			int a = sc.nextInt();
			
			 sum =sum+a;
			 
		int i = 0;

		     min = Math.min(min,a);
		     max = Math.max(max,a);   	

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

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		
		int j = 0;
		int b = sc.nextInt();
		
		int min = b;
        int max = b;
        long sum = b;
        
		for(j=0;j<n-1;j++){
			int a = sc.nextInt();
			
			 sum =sum+a;
			 
		int i = 0;

		     min = Math.min(min,a);
		     max = Math.max(max,a);   	

		}
		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 = sc.nextInt();
		
		int j = 0;
		int b = sc.nextInt();
		
		int min = b;
        int max = b;
        long sum = b;
        
		for(j=0;j<n-1;j++){
			int a = sc.nextInt();
			
			 sum =sum+a;
			 
		int i = 0;

		     min = Math.min(min,a);
		     max = Math.max(max,a);   	

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

}
