import java.io.*;
public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String str = br.readLine();
        String[] strs = str.split(" ");
        int min = 0;//最小
        int max = 0;//最大
        long sum = 0;//合計
        if(strs.length > 0){
            min = Integer.parseInt(strs[0]);
            max = Integer.parseInt(strs[0]);
        }
        for(int i = 0; i < n; i++){
            if(min > Integer.parseInt(strs[i])){
                min = Integer.parseInt(strs[i]);
            }else if(max < Integer.parseInt(strs[i])){
                max = Integer.parseInt(strs[i]);
            }//if
            sum += Integer.parseInt(strs[i]);
        }//for
        System.out.println(min + " " + max + " " + sum);
	}
} import java.io.*; io.* java public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String str = br.readLine();
        String[] strs = str.split(" ");
        int min = 0;//最小
        int max = 0;//最大
        long sum = 0;//合計
        if(strs.length > 0){
            min = Integer.parseInt(strs[0]);
            max = Integer.parseInt(strs[0]);
        }
        for(int i = 0; i < n; i++){
            if(min > Integer.parseInt(strs[i])){
                min = Integer.parseInt(strs[i]);
            }else if(max < Integer.parseInt(strs[i])){
                max = Integer.parseInt(strs[i]);
            }//if
            sum += Integer.parseInt(strs[i]);
        }//for
        System.out.println(min + " " + max + " " + sum);
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String str = br.readLine();
        String[] strs = str.split(" ");
        int min = 0;//最小
        int max = 0;//最大
        long sum = 0;//合計
        if(strs.length > 0){
            min = Integer.parseInt(strs[0]);
            max = Integer.parseInt(strs[0]);
        }
        for(int i = 0; i < n; i++){
            if(min > Integer.parseInt(strs[i])){
                min = Integer.parseInt(strs[i]);
            }else if(max < Integer.parseInt(strs[i])){
                max = Integer.parseInt(strs[i]);
            }//if
            sum += Integer.parseInt(strs[i]);
        }//for
        System.out.println(min + " " + max + " " + sum);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String str = br.readLine();
        String[] strs = str.split(" ");
        int min = 0;//最小
        int max = 0;//最大
        long sum = 0;//合計
        if(strs.length > 0){
            min = Integer.parseInt(strs[0]);
            max = Integer.parseInt(strs[0]);
        }
        for(int i = 0; i < n; i++){
            if(min > Integer.parseInt(strs[i])){
                min = Integer.parseInt(strs[i]);
            }else if(max < Integer.parseInt(strs[i])){
                max = Integer.parseInt(strs[i]);
            }//if
            sum += Integer.parseInt(strs[i]);
        }//for
        System.out.println(min + " " + max + " " + sum);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String str = br.readLine(); str br.readLine() br.readLine br String[] strs = str.split(" "); strs str.split(" ") str.split str " " int min = 0; min 0 int max = 0; max 0 long sum = 0; sum 0 if(strs.length > 0){
            min = Integer.parseInt(strs[0]);
            max = Integer.parseInt(strs[0]);
        } strs.length > 0 strs.length strs strs.length 0 {
            min = Integer.parseInt(strs[0]);
            max = Integer.parseInt(strs[0]);
        } min = Integer.parseInt(strs[0]) min Integer.parseInt(strs[0]) Integer.parseInt Integer strs[0] strs 0 max = Integer.parseInt(strs[0]) max Integer.parseInt(strs[0]) Integer.parseInt Integer strs[0] strs 0 for(int i = 0; i < n; i++){
            if(min > Integer.parseInt(strs[i])){
                min = Integer.parseInt(strs[i]);
            }else if(max < Integer.parseInt(strs[i])){
                max = Integer.parseInt(strs[i]);
            }//if
            sum += Integer.parseInt(strs[i]);
        }//for int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            if(min > Integer.parseInt(strs[i])){
                min = Integer.parseInt(strs[i]);
            }else if(max < Integer.parseInt(strs[i])){
                max = Integer.parseInt(strs[i]);
            }//if
            sum += Integer.parseInt(strs[i]);
        }//for {
            if(min > Integer.parseInt(strs[i])){
                min = Integer.parseInt(strs[i]);
            }else if(max < Integer.parseInt(strs[i])){
                max = Integer.parseInt(strs[i]);
            }//if
            sum += Integer.parseInt(strs[i]);
        } if(min > Integer.parseInt(strs[i])){
                min = Integer.parseInt(strs[i]);
            }else if(max < Integer.parseInt(strs[i])){
                max = Integer.parseInt(strs[i]);
            }//if min > Integer.parseInt(strs[i]) min Integer.parseInt(strs[i]) Integer.parseInt Integer strs[i] strs i {
                min = Integer.parseInt(strs[i]);
            } min = Integer.parseInt(strs[i]) min Integer.parseInt(strs[i]) Integer.parseInt Integer strs[i] strs i if(max < Integer.parseInt(strs[i])){
                max = Integer.parseInt(strs[i]);
            }//if max < Integer.parseInt(strs[i]) max Integer.parseInt(strs[i]) Integer.parseInt Integer strs[i] strs i {
                max = Integer.parseInt(strs[i]);
            } max = Integer.parseInt(strs[i]) max Integer.parseInt(strs[i]) Integer.parseInt Integer strs[i] strs i sum += Integer.parseInt(strs[i]) sum Integer.parseInt(strs[i]) Integer.parseInt Integer strs[i] strs i 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 {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String str = br.readLine();
        String[] strs = str.split(" ");
        int min = 0;//最小
        int max = 0;//最大
        long sum = 0;//合計
        if(strs.length > 0){
            min = Integer.parseInt(strs[0]);
            max = Integer.parseInt(strs[0]);
        }
        for(int i = 0; i < n; i++){
            if(min > Integer.parseInt(strs[i])){
                min = Integer.parseInt(strs[i]);
            }else if(max < Integer.parseInt(strs[i])){
                max = Integer.parseInt(strs[i]);
            }//if
            sum += Integer.parseInt(strs[i]);
        }//for
        System.out.println(min + " " + max + " " + sum);
	}
} public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String str = br.readLine();
        String[] strs = str.split(" ");
        int min = 0;//最小
        int max = 0;//最大
        long sum = 0;//合計
        if(strs.length > 0){
            min = Integer.parseInt(strs[0]);
            max = Integer.parseInt(strs[0]);
        }
        for(int i = 0; i < n; i++){
            if(min > Integer.parseInt(strs[i])){
                min = Integer.parseInt(strs[i]);
            }else if(max < Integer.parseInt(strs[i])){
                max = Integer.parseInt(strs[i]);
            }//if
            sum += Integer.parseInt(strs[i]);
        }//for
        System.out.println(min + " " + max + " " + sum);
	}
} Main
import java.io.*;
public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String str = br.readLine();
        String[] strs = str.split(" ");
        int min = 0;//最小
        int max = 0;//最大
        long sum = 0;//合計
        if(strs.length > 0){
            min = Integer.parseInt(strs[0]);
            max = Integer.parseInt(strs[0]);
        }
        for(int i = 0; i < n; i++){
            if(min > Integer.parseInt(strs[i])){
                min = Integer.parseInt(strs[i]);
            }else if(max < Integer.parseInt(strs[i])){
                max = Integer.parseInt(strs[i]);
            }//if
            sum += Integer.parseInt(strs[i]);
        }//for
        System.out.println(min + " " + max + " " + sum);
	}
}