import java.util.*;

/**
 * Created by khrom on 2017/06/15.
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        List<Integer> numList = new ArrayList<>();
        for (int i = 0; i < n; i++)
            numList.add(scanner.nextInt());
        Collections.sort(numList);
        long sum = 0;
        for (Integer integer : numList)
            sum += integer;
        System.out.println(numList.get(0) + " " + numList.get(numList.size() - 1) + " " + sum);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        List<Integer> numList = new ArrayList<>();
        for (int i = 0; i < n; i++)
            numList.add(scanner.nextInt());
        Collections.sort(numList);
        long sum = 0;
        for (Integer integer : numList)
            sum += integer;
        System.out.println(numList.get(0) + " " + numList.get(numList.size() - 1) + " " + sum);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        List<Integer> numList = new ArrayList<>();
        for (int i = 0; i < n; i++)
            numList.add(scanner.nextInt());
        Collections.sort(numList);
        long sum = 0;
        for (Integer integer : numList)
            sum += integer;
        System.out.println(numList.get(0) + " " + numList.get(numList.size() - 1) + " " + sum);
    } main {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        List<Integer> numList = new ArrayList<>();
        for (int i = 0; i < n; i++)
            numList.add(scanner.nextInt());
        Collections.sort(numList);
        long sum = 0;
        for (Integer integer : numList)
            sum += integer;
        System.out.println(numList.get(0) + " " + numList.get(numList.size() - 1) + " " + sum);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner List<Integer> numList = new ArrayList<>(); numList new ArrayList<>() for (int i = 0; i < n; i++)
            numList.add(scanner.nextInt()); int i = 0; int i = 0; i 0 i < n i n i++ i++ i numList.add(scanner.nextInt()); numList.add(scanner.nextInt()) numList.add numList scanner.nextInt() scanner.nextInt scanner Collections.sort(numList) Collections.sort Collections numList long sum = 0; sum 0 for (Integer integer : numList)
            sum += integer; Integer integer numList sum += integer; sum += integer sum integer System.out.println(numList.get(0) + " " + numList.get(numList.size() - 1) + " " + sum) System.out.println System.out System System.out numList.get(0) + " " + numList.get(numList.size() - 1) + " " + sum " " numList.get(numList.size() - 1) numList.get(0) + " " + numList.get(numList.size() - 1) + " " + sum numList.get(0) numList.get numList 0 " " numList.get(numList.size() - 1) numList.get numList numList.size() - 1 numList.size() numList.size numList 1 " " sum String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        List<Integer> numList = new ArrayList<>();
        for (int i = 0; i < n; i++)
            numList.add(scanner.nextInt());
        Collections.sort(numList);
        long sum = 0;
        for (Integer integer : numList)
            sum += integer;
        System.out.println(numList.get(0) + " " + numList.get(numList.size() - 1) + " " + sum);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        List<Integer> numList = new ArrayList<>();
        for (int i = 0; i < n; i++)
            numList.add(scanner.nextInt());
        Collections.sort(numList);
        long sum = 0;
        for (Integer integer : numList)
            sum += integer;
        System.out.println(numList.get(0) + " " + numList.get(numList.size() - 1) + " " + sum);
    }
} Main
import java.util.*;

/**
 * Created by khrom on 2017/06/15.
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        List<Integer> numList = new ArrayList<>();
        for (int i = 0; i < n; i++)
            numList.add(scanner.nextInt());
        Collections.sort(numList);
        long sum = 0;
        for (Integer integer : numList)
            sum += integer;
        System.out.println(numList.get(0) + " " + numList.get(numList.size() - 1) + " " + sum);
    }
}