import java.util.*;
import java.text.*;

class Main {
    public static void main(String[]args)throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int mx = Integer.MIN_VALUE;
        int mn = Integer.MAX_VALUE;
        long sum = 0;
        for(int i = 0; i < n; i++) {
            int a = sc.nextInt();
            if(a > mx) mx = a;
            if(a < mn) mn = a;
            sum += a;
        }
        System.out.println("" + mn + " " + mx + " " + sum);
    }
} import java.util.*; util.* java import java.text.*; text.* java class Main {
    public static void main(String[]args)throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int mx = Integer.MIN_VALUE;
        int mn = Integer.MAX_VALUE;
        long sum = 0;
        for(int i = 0; i < n; i++) {
            int a = sc.nextInt();
            if(a > mx) mx = a;
            if(a < mn) mn = a;
            sum += a;
        }
        System.out.println("" + mn + " " + mx + " " + sum);
    }
} Main public static void main(String[]args)throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int mx = Integer.MIN_VALUE;
        int mn = Integer.MAX_VALUE;
        long sum = 0;
        for(int i = 0; i < n; i++) {
            int a = sc.nextInt();
            if(a > mx) mx = a;
            if(a < mn) mn = a;
            sum += a;
        }
        System.out.println("" + mn + " " + mx + " " + sum);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int mx = Integer.MIN_VALUE;
        int mn = Integer.MAX_VALUE;
        long sum = 0;
        for(int i = 0; i < n; i++) {
            int a = sc.nextInt();
            if(a > mx) mx = a;
            if(a < mn) mn = a;
            sum += a;
        }
        System.out.println("" + mn + " " + mx + " " + sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int mx = Integer.MIN_VALUE; mx Integer.MIN_VALUE Integer Integer.MIN_VALUE int mn = Integer.MAX_VALUE; mn Integer.MAX_VALUE Integer Integer.MAX_VALUE long sum = 0; sum 0 for(int i = 0; i < n; i++) {
            int a = sc.nextInt();
            if(a > mx) mx = a;
            if(a < mn) mn = a;
            sum += a;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            int a = sc.nextInt();
            if(a > mx) mx = a;
            if(a < mn) mn = a;
            sum += a;
        } {
            int a = sc.nextInt();
            if(a > mx) mx = a;
            if(a < mn) mn = a;
            sum += a;
        } int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc if(a > mx) mx = a; a > mx a mx mx = a mx a if(a < mn) mn = a; a < mn a mn mn = a mn a sum += a sum a System.out.println("" + mn + " " + mx + " " + sum) System.out.println System.out System System.out "" + mn + " " + mx + " " + sum " " mx " " "" + mn + " " + mx + " " + sum "" mn " " mx " " sum String[]args args
import java.util.*;
import java.text.*;

class Main {
    public static void main(String[]args)throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int mx = Integer.MIN_VALUE;
        int mn = Integer.MAX_VALUE;
        long sum = 0;
        for(int i = 0; i < n; i++) {
            int a = sc.nextInt();
            if(a > mx) mx = a;
            if(a < mn) mn = a;
            sum += a;
        }
        System.out.println("" + mn + " " + mx + " " + sum);
    }
}