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);
    	StringBuilder sb = new StringBuilder();
    	int max = -1000000;
        int min = 1000000;
    	int num =sc.nextInt();
    	int tmp = 0;
    	long sum = 0;
    	for (int i=0;i<num;i++){
    		int a = sc.nextInt();
    		if(a>max){
    			max=a;
    		}

    		if(min>a){
    			min=a;
    		}
    		sum = sum+a;
    	}
        sb.append(min).append(" ").append(max).append(" ").append(sum);
    	System.out.println(sb);
    }

} 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);
    	StringBuilder sb = new StringBuilder();
    	int max = -1000000;
        int min = 1000000;
    	int num =sc.nextInt();
    	int tmp = 0;
    	long sum = 0;
    	for (int i=0;i<num;i++){
    		int a = sc.nextInt();
    		if(a>max){
    			max=a;
    		}

    		if(min>a){
    			min=a;
    		}
    		sum = sum+a;
    	}
        sb.append(min).append(" ").append(max).append(" ").append(sum);
    	System.out.println(sb);
    }

} Main public static void main (String args[]) throws IOException {
    	Scanner sc = new Scanner(System.in);
    	StringBuilder sb = new StringBuilder();
    	int max = -1000000;
        int min = 1000000;
    	int num =sc.nextInt();
    	int tmp = 0;
    	long sum = 0;
    	for (int i=0;i<num;i++){
    		int a = sc.nextInt();
    		if(a>max){
    			max=a;
    		}

    		if(min>a){
    			min=a;
    		}
    		sum = sum+a;
    	}
        sb.append(min).append(" ").append(max).append(" ").append(sum);
    	System.out.println(sb);
    } main {
    	Scanner sc = new Scanner(System.in);
    	StringBuilder sb = new StringBuilder();
    	int max = -1000000;
        int min = 1000000;
    	int num =sc.nextInt();
    	int tmp = 0;
    	long sum = 0;
    	for (int i=0;i<num;i++){
    		int a = sc.nextInt();
    		if(a>max){
    			max=a;
    		}

    		if(min>a){
    			min=a;
    		}
    		sum = sum+a;
    	}
        sb.append(min).append(" ").append(max).append(" ").append(sum);
    	System.out.println(sb);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) StringBuilder sb = new StringBuilder(); sb new StringBuilder() int max = -1000000; max -1000000 1000000 int min = 1000000; min 1000000 int num =sc.nextInt(); num sc.nextInt() sc.nextInt sc int tmp = 0; tmp 0 long sum = 0; sum 0 for (int i=0;i<num;i++){
    		int a = sc.nextInt();
    		if(a>max){
    			max=a;
    		}

    		if(min>a){
    			min=a;
    		}
    		sum = sum+a;
    	} int i=0; int i=0; i 0 i<num i num i++ i++ i {
    		int a = sc.nextInt();
    		if(a>max){
    			max=a;
    		}

    		if(min>a){
    			min=a;
    		}
    		sum = sum+a;
    	} {
    		int a = sc.nextInt();
    		if(a>max){
    			max=a;
    		}

    		if(min>a){
    			min=a;
    		}
    		sum = sum+a;
    	} int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc if(a>max){
    			max=a;
    		} a>max a max {
    			max=a;
    		} max=a max a if(min>a){
    			min=a;
    		} min>a min a {
    			min=a;
    		} min=a min a sum = sum+a sum sum+a sum a sb.append(min).append(" ").append(max).append(" ").append(sum) sb.append(min).append(" ").append(max).append(" ").append sb.append(min).append(" ").append(max).append(" ") sb.append(min).append(" ").append(max).append sb.append(min).append(" ").append(max) sb.append(min).append(" ").append sb.append(min).append(" ") sb.append(min).append sb.append(min) sb.append sb min " " max " " sum System.out.println(sb) System.out.println System.out System System.out sb String args[] args public class Main {
    public static void main (String args[]) throws IOException {
    	Scanner sc = new Scanner(System.in);
    	StringBuilder sb = new StringBuilder();
    	int max = -1000000;
        int min = 1000000;
    	int num =sc.nextInt();
    	int tmp = 0;
    	long sum = 0;
    	for (int i=0;i<num;i++){
    		int a = sc.nextInt();
    		if(a>max){
    			max=a;
    		}

    		if(min>a){
    			min=a;
    		}
    		sum = sum+a;
    	}
        sb.append(min).append(" ").append(max).append(" ").append(sum);
    	System.out.println(sb);
    }

} public class Main {
    public static void main (String args[]) throws IOException {
    	Scanner sc = new Scanner(System.in);
    	StringBuilder sb = new StringBuilder();
    	int max = -1000000;
        int min = 1000000;
    	int num =sc.nextInt();
    	int tmp = 0;
    	long sum = 0;
    	for (int i=0;i<num;i++){
    		int a = sc.nextInt();
    		if(a>max){
    			max=a;
    		}

    		if(min>a){
    			min=a;
    		}
    		sum = sum+a;
    	}
        sb.append(min).append(" ").append(max).append(" ").append(sum);
    	System.out.println(sb);
    }

} 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);
    	StringBuilder sb = new StringBuilder();
    	int max = -1000000;
        int min = 1000000;
    	int num =sc.nextInt();
    	int tmp = 0;
    	long sum = 0;
    	for (int i=0;i<num;i++){
    		int a = sc.nextInt();
    		if(a>max){
    			max=a;
    		}

    		if(min>a){
    			min=a;
    		}
    		sum = sum+a;
    	}
        sb.append(min).append(" ").append(max).append(" ").append(sum);
    	System.out.println(sb);
    }

}