import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
import java.util.List;

public class Main {
    public static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
        int n = sc.nextInt();
        long sum = 0;
        List<Long> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            long l = sc.nextLong();
            list.add(l);
            sum += l;
        }
        
        Collections.sort(list);
        
        System.out.println(list.get(0) + " " + list.get(n-1) + " " + sum);
    }
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util import java.util.List; List java.util public class Main {
    public static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
        int n = sc.nextInt();
        long sum = 0;
        List<Long> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            long l = sc.nextLong();
            list.add(l);
            sum += l;
        }
        
        Collections.sort(list);
        
        System.out.println(list.get(0) + " " + list.get(n-1) + " " + sum);
    }
} Main public static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) throws Exception {
        int n = sc.nextInt();
        long sum = 0;
        List<Long> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            long l = sc.nextLong();
            list.add(l);
            sum += l;
        }
        
        Collections.sort(list);
        
        System.out.println(list.get(0) + " " + list.get(n-1) + " " + sum);
    } main {
        int n = sc.nextInt();
        long sum = 0;
        List<Long> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            long l = sc.nextLong();
            list.add(l);
            sum += l;
        }
        
        Collections.sort(list);
        
        System.out.println(list.get(0) + " " + list.get(n-1) + " " + sum);
    } int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc long sum = 0; sum 0 List<Long> list = new ArrayList<>(); list new ArrayList<>() for (int i = 0; i < n; i++) {
            long l = sc.nextLong();
            list.add(l);
            sum += l;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            long l = sc.nextLong();
            list.add(l);
            sum += l;
        } {
            long l = sc.nextLong();
            list.add(l);
            sum += l;
        } long l = sc.nextLong(); l sc.nextLong() sc.nextLong sc list.add(l) list.add list l sum += l sum l Collections.sort(list) Collections.sort Collections list System.out.println(list.get(0) + " " + list.get(n-1) + " " + sum) System.out.println System.out System System.out list.get(0) + " " + list.get(n-1) + " " + sum " " list.get(n-1) list.get(0) + " " + list.get(n-1) + " " + sum list.get(0) list.get list 0 " " list.get(n-1) list.get list n-1 n 1 " " sum String[] args args public class Main {
    public static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
        int n = sc.nextInt();
        long sum = 0;
        List<Long> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            long l = sc.nextLong();
            list.add(l);
            sum += l;
        }
        
        Collections.sort(list);
        
        System.out.println(list.get(0) + " " + list.get(n-1) + " " + sum);
    }
} public class Main {
    public static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
        int n = sc.nextInt();
        long sum = 0;
        List<Long> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            long l = sc.nextLong();
            list.add(l);
            sum += l;
        }
        
        Collections.sort(list);
        
        System.out.println(list.get(0) + " " + list.get(n-1) + " " + sum);
    }
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
import java.util.List;

public class Main {
    public static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
        int n = sc.nextInt();
        long sum = 0;
        List<Long> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            long l = sc.nextLong();
            list.add(l);
            sum += l;
        }
        
        Collections.sort(list);
        
        System.out.println(list.get(0) + " " + list.get(n-1) + " " + sum);
    }
}