import java.io.*;

class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.parseInt(br.readLine());
        String[] ary = br.readLine().split(" ");
        int min = 1000000;
        int max = -1000000;
        long sum = 0;
        for(int i=0;i<N;i++){
            int num = Integer.parseInt(ary[i]);
            if(num<min) min = num;
            if(num>max) max = num;
            sum += num;
        }
        System.out.println(min+" "+max+" "+sum);
	}
} import java.io.*; io.* java class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.parseInt(br.readLine());
        String[] ary = br.readLine().split(" ");
        int min = 1000000;
        int max = -1000000;
        long sum = 0;
        for(int i=0;i<N;i++){
            int num = Integer.parseInt(ary[i]);
            if(num<min) min = num;
            if(num>max) max = num;
            sum += num;
        }
        System.out.println(min+" "+max+" "+sum);
	}
} Main public static void main(String[] args) throws Exception {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.parseInt(br.readLine());
        String[] ary = br.readLine().split(" ");
        int min = 1000000;
        int max = -1000000;
        long sum = 0;
        for(int i=0;i<N;i++){
            int num = Integer.parseInt(ary[i]);
            if(num<min) min = num;
            if(num>max) max = num;
            sum += num;
        }
        System.out.println(min+" "+max+" "+sum);
	} main {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.parseInt(br.readLine());
        String[] ary = br.readLine().split(" ");
        int min = 1000000;
        int max = -1000000;
        long sum = 0;
        for(int i=0;i<N;i++){
            int num = Integer.parseInt(ary[i]);
            if(num<min) min = num;
            if(num>max) max = num;
            sum += num;
        }
        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[] ary = br.readLine().split(" "); ary br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int min = 1000000; min 1000000 int max = -1000000; max -1000000 1000000 long sum = 0; sum 0 for(int i=0;i<N;i++){
            int num = Integer.parseInt(ary[i]);
            if(num<min) min = num;
            if(num>max) max = num;
            sum += num;
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            int num = Integer.parseInt(ary[i]);
            if(num<min) min = num;
            if(num>max) max = num;
            sum += num;
        } {
            int num = Integer.parseInt(ary[i]);
            if(num<min) min = num;
            if(num>max) max = num;
            sum += num;
        } int num = Integer.parseInt(ary[i]); num Integer.parseInt(ary[i]) Integer.parseInt Integer ary[i] ary i if(num<min) min = num; num<min num min min = num min num if(num>max) max = num; num>max num max max = num max num sum += num sum num 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
import java.io.*;

class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.parseInt(br.readLine());
        String[] ary = br.readLine().split(" ");
        int min = 1000000;
        int max = -1000000;
        long sum = 0;
        for(int i=0;i<N;i++){
            int num = Integer.parseInt(ary[i]);
            if(num<min) min = num;
            if(num>max) max = num;
            sum += num;
        }
        System.out.println(min+" "+max+" "+sum);
	}
}