import java.io.*;
import java.util.*;

class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n=Integer.parseInt(br.readLine());
        long[] array=new long[n];
        StringTokenizer st=new StringTokenizer(br.readLine());
        long sum=0;
        for(int i=0;i<n;i++){ array[i]=Long.parseLong(st.nextToken()); sum+=array[i]; }
        Arrays.sort(array);
        System.out.println(array[0]+" "+array[n-1]+" "+sum);
    }
} import java.io.*; io.* java import java.util.*; util.* java class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n=Integer.parseInt(br.readLine());
        long[] array=new long[n];
        StringTokenizer st=new StringTokenizer(br.readLine());
        long sum=0;
        for(int i=0;i<n;i++){ array[i]=Long.parseLong(st.nextToken()); sum+=array[i]; }
        Arrays.sort(array);
        System.out.println(array[0]+" "+array[n-1]+" "+sum);
    }
} Main public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n=Integer.parseInt(br.readLine());
        long[] array=new long[n];
        StringTokenizer st=new StringTokenizer(br.readLine());
        long sum=0;
        for(int i=0;i<n;i++){ array[i]=Long.parseLong(st.nextToken()); sum+=array[i]; }
        Arrays.sort(array);
        System.out.println(array[0]+" "+array[n-1]+" "+sum);
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n=Integer.parseInt(br.readLine());
        long[] array=new long[n];
        StringTokenizer st=new StringTokenizer(br.readLine());
        long sum=0;
        for(int i=0;i<n;i++){ array[i]=Long.parseLong(st.nextToken()); sum+=array[i]; }
        Arrays.sort(array);
        System.out.println(array[0]+" "+array[n-1]+" "+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 long[] array=new long[n]; array new long[n] n StringTokenizer st=new StringTokenizer(br.readLine()); st new StringTokenizer(br.readLine()) long sum=0; sum 0 for(int i=0;i<n;i++){ array[i]=Long.parseLong(st.nextToken()); sum+=array[i]; } int i=0; int i=0; i 0 i<n i n i++ i++ i { array[i]=Long.parseLong(st.nextToken()); sum+=array[i]; } { array[i]=Long.parseLong(st.nextToken()); sum+=array[i]; } array[i]=Long.parseLong(st.nextToken()) array[i] array i Long.parseLong(st.nextToken()) Long.parseLong Long st.nextToken() st.nextToken st sum+=array[i] sum array[i] array i Arrays.sort(array) Arrays.sort Arrays array System.out.println(array[0]+" "+array[n-1]+" "+sum) System.out.println System.out System System.out array[0]+" "+array[n-1]+" "+sum " " array[n-1] array[0]+" "+array[n-1]+" "+sum array[0] array 0 " " array[n-1] array n-1 n 1 " " sum String[] args args
import java.io.*;
import java.util.*;

class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n=Integer.parseInt(br.readLine());
        long[] array=new long[n];
        StringTokenizer st=new StringTokenizer(br.readLine());
        long sum=0;
        for(int i=0;i<n;i++){ array[i]=Long.parseLong(st.nextToken()); sum+=array[i]; }
        Arrays.sort(array);
        System.out.println(array[0]+" "+array[n-1]+" "+sum);
    }
}