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

public class Main {
    private static Scanner scan;

    public static void main(String[] args) {
        scan = new Scanner(System.in);
        int n = scan.nextInt();
        ArrayList<Long> list = new ArrayList<Long>();
        long input = 0;
        long sum = 0;
        for (int i = 0; i < n; i++) {
            input = scan.nextLong();
            sum += input;
            list.add(input);
        }
        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 public class Main {
    private static Scanner scan;

    public static void main(String[] args) {
        scan = new Scanner(System.in);
        int n = scan.nextInt();
        ArrayList<Long> list = new ArrayList<Long>();
        long input = 0;
        long sum = 0;
        for (int i = 0; i < n; i++) {
            input = scan.nextLong();
            sum += input;
            list.add(input);
        }
        Collections.sort(list);
        System.out.println(list.get(0) + " " + list.get(n-1) + " " + sum);
    }
} Main private static Scanner scan; scan public static void main(String[] args) {
        scan = new Scanner(System.in);
        int n = scan.nextInt();
        ArrayList<Long> list = new ArrayList<Long>();
        long input = 0;
        long sum = 0;
        for (int i = 0; i < n; i++) {
            input = scan.nextLong();
            sum += input;
            list.add(input);
        }
        Collections.sort(list);
        System.out.println(list.get(0) + " " + list.get(n-1) + " " + sum);
    } main {
        scan = new Scanner(System.in);
        int n = scan.nextInt();
        ArrayList<Long> list = new ArrayList<Long>();
        long input = 0;
        long sum = 0;
        for (int i = 0; i < n; i++) {
            input = scan.nextLong();
            sum += input;
            list.add(input);
        }
        Collections.sort(list);
        System.out.println(list.get(0) + " " + list.get(n-1) + " " + sum);
    } scan = new Scanner(System.in) scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan ArrayList<Long> list = new ArrayList<Long>(); list new ArrayList<Long>() long input = 0; input 0 long sum = 0; sum 0 for (int i = 0; i < n; i++) {
            input = scan.nextLong();
            sum += input;
            list.add(input);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            input = scan.nextLong();
            sum += input;
            list.add(input);
        } {
            input = scan.nextLong();
            sum += input;
            list.add(input);
        } input = scan.nextLong() input scan.nextLong() scan.nextLong scan sum += input sum input list.add(input) list.add list input 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 {
    private static Scanner scan;

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

    public static void main(String[] args) {
        scan = new Scanner(System.in);
        int n = scan.nextInt();
        ArrayList<Long> list = new ArrayList<Long>();
        long input = 0;
        long sum = 0;
        for (int i = 0; i < n; i++) {
            input = scan.nextLong();
            sum += input;
            list.add(input);
        }
        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;

public class Main {
    private static Scanner scan;

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