import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

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().split(" ");
        int a = Integer.parseInt(str[0]);
        int max=a;
        int min=a;
        long total=a;
        for(int i=1;i<n;i++){
            int b = Integer.parseInt(str[i]);
            if(max<b) max=b;
            if(min>b) min=b;
            total = total + b;
        }
        System.out.println(min+" "+max+" "+total);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader 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().split(" ");
        int a = Integer.parseInt(str[0]);
        int max=a;
        int min=a;
        long total=a;
        for(int i=1;i<n;i++){
            int b = Integer.parseInt(str[i]);
            if(max<b) max=b;
            if(min>b) min=b;
            total = total + b;
        }
        System.out.println(min+" "+max+" "+total);
    }
} 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().split(" ");
        int a = Integer.parseInt(str[0]);
        int max=a;
        int min=a;
        long total=a;
        for(int i=1;i<n;i++){
            int b = Integer.parseInt(str[i]);
            if(max<b) max=b;
            if(min>b) min=b;
            total = total + b;
        }
        System.out.println(min+" "+max+" "+total);
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String str[] = br.readLine().split(" ");
        int a = Integer.parseInt(str[0]);
        int max=a;
        int min=a;
        long total=a;
        for(int i=1;i<n;i++){
            int b = Integer.parseInt(str[i]);
            if(max<b) max=b;
            if(min>b) min=b;
            total = total + b;
        }
        System.out.println(min+" "+max+" "+total);
    } 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().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int a = Integer.parseInt(str[0]); a Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 int max=a; max a int min=a; min a long total=a; total a for(int i=1;i<n;i++){
            int b = Integer.parseInt(str[i]);
            if(max<b) max=b;
            if(min>b) min=b;
            total = total + b;
        } int i=1; int i=1; i 1 i<n i n i++ i++ i {
            int b = Integer.parseInt(str[i]);
            if(max<b) max=b;
            if(min>b) min=b;
            total = total + b;
        } {
            int b = Integer.parseInt(str[i]);
            if(max<b) max=b;
            if(min>b) min=b;
            total = total + b;
        } int b = Integer.parseInt(str[i]); b Integer.parseInt(str[i]) Integer.parseInt Integer str[i] str i if(max<b) max=b; max<b max b max=b max b if(min>b) min=b; min>b min b min=b min b total = total + b total total + b total b System.out.println(min+" "+max+" "+total) System.out.println System.out System System.out min+" "+max+" "+total " " max min+" "+max+" "+total min " " max " " total 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().split(" ");
        int a = Integer.parseInt(str[0]);
        int max=a;
        int min=a;
        long total=a;
        for(int i=1;i<n;i++){
            int b = Integer.parseInt(str[i]);
            if(max<b) max=b;
            if(min>b) min=b;
            total = total + b;
        }
        System.out.println(min+" "+max+" "+total);
    }
} 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().split(" ");
        int a = Integer.parseInt(str[0]);
        int max=a;
        int min=a;
        long total=a;
        for(int i=1;i<n;i++){
            int b = Integer.parseInt(str[i]);
            if(max<b) max=b;
            if(min>b) min=b;
            total = total + b;
        }
        System.out.println(min+" "+max+" "+total);
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

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().split(" ");
        int a = Integer.parseInt(str[0]);
        int max=a;
        int min=a;
        long total=a;
        for(int i=1;i<n;i++){
            int b = Integer.parseInt(str[i]);
            if(max<b) max=b;
            if(min>b) min=b;
            total = total + b;
        }
        System.out.println(min+" "+max+" "+total);
    }
}