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[] array = br.readLine().split(" ");
        int num = Integer.parseInt(array[0]);
        int min=num,max=num;
        long sum=num;
        for(int i=1;i<N;i++){
            num=Integer.parseInt(array[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[] array = br.readLine().split(" ");
        int num = Integer.parseInt(array[0]);
        int min=num,max=num;
        long sum=num;
        for(int i=1;i<N;i++){
            num=Integer.parseInt(array[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[] array = br.readLine().split(" ");
        int num = Integer.parseInt(array[0]);
        int min=num,max=num;
        long sum=num;
        for(int i=1;i<N;i++){
            num=Integer.parseInt(array[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[] array = br.readLine().split(" ");
        int num = Integer.parseInt(array[0]);
        int min=num,max=num;
        long sum=num;
        for(int i=1;i<N;i++){
            num=Integer.parseInt(array[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[] array = br.readLine().split(" "); array br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int num = Integer.parseInt(array[0]); num Integer.parseInt(array[0]) Integer.parseInt Integer array[0] array 0 int min=num min num max=num; max num long sum=num; sum num for(int i=1;i<N;i++){
            num=Integer.parseInt(array[i]);
            if(num<min) min=num;
            if(num>max) max=num;
            sum+=num;
        } int i=1; int i=1; i 1 i<N i N i++ i++ i {
            num=Integer.parseInt(array[i]);
            if(num<min) min=num;
            if(num>max) max=num;
            sum+=num;
        } {
            num=Integer.parseInt(array[i]);
            if(num<min) min=num;
            if(num>max) max=num;
            sum+=num;
        } num=Integer.parseInt(array[i]) num Integer.parseInt(array[i]) Integer.parseInt Integer array[i] array 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[] array = br.readLine().split(" ");
        int num = Integer.parseInt(array[0]);
        int min=num,max=num;
        long sum=num;
        for(int i=1;i<N;i++){
            num=Integer.parseInt(array[i]);
            if(num<min) min=num;
            if(num>max) max=num;
            sum+=num;
        }
        System.out.println(min+" "+max+" "+sum);
	}
}