import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] a = new int[n];
        long max, min, sum = 0;
        ArrayList<Integer> z = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            z.add(scan.nextInt());
            sum += z.get(i);
//            a[i] = scan.nextInt();
        }
        max = Collections.max(z);
        min = Collections.min(z);

//        max = a[0];
//        min = a[0];

        /*for (int num : a) {
            if (max < num) {
                max = num;
            } else if (min > num) {
                min = num;
            }
            sum += num;
        }*/
        System.out.println(min + " " + max + " " + sum);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] a = new int[n];
        long max, min, sum = 0;
        ArrayList<Integer> z = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            z.add(scan.nextInt());
            sum += z.get(i);
//            a[i] = scan.nextInt();
        }
        max = Collections.max(z);
        min = Collections.min(z);

//        max = a[0];
//        min = a[0];

        /*for (int num : a) {
            if (max < num) {
                max = num;
            } else if (min > num) {
                min = num;
            }
            sum += num;
        }*/
        System.out.println(min + " " + max + " " + sum);
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] a = new int[n];
        long max, min, sum = 0;
        ArrayList<Integer> z = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            z.add(scan.nextInt());
            sum += z.get(i);
//            a[i] = scan.nextInt();
        }
        max = Collections.max(z);
        min = Collections.min(z);

//        max = a[0];
//        min = a[0];

        /*for (int num : a) {
            if (max < num) {
                max = num;
            } else if (min > num) {
                min = num;
            }
            sum += num;
        }*/
        System.out.println(min + " " + max + " " + sum);
    } main {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] a = new int[n];
        long max, min, sum = 0;
        ArrayList<Integer> z = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            z.add(scan.nextInt());
            sum += z.get(i);
//            a[i] = scan.nextInt();
        }
        max = Collections.max(z);
        min = Collections.min(z);

//        max = a[0];
//        min = a[0];

        /*for (int num : a) {
            if (max < num) {
                max = num;
            } else if (min > num) {
                min = num;
            }
            sum += num;
        }*/
        System.out.println(min + " " + max + " " + sum);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int[] a = new int[n]; a new int[n] n long max max min min sum = 0; sum 0 ArrayList<Integer> z = new ArrayList<>(); z new ArrayList<>() for (int i = 0; i < n; i++) {
            z.add(scan.nextInt());
            sum += z.get(i);
//            a[i] = scan.nextInt();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            z.add(scan.nextInt());
            sum += z.get(i);
//            a[i] = scan.nextInt();
        } {
            z.add(scan.nextInt());
            sum += z.get(i);
//            a[i] = scan.nextInt();
        } z.add(scan.nextInt()) z.add z scan.nextInt() scan.nextInt scan sum += z.get(i) sum z.get(i) z.get z i max = Collections.max(z) max Collections.max(z) Collections.max Collections z min = Collections.min(z) min Collections.min(z) Collections.min Collections z System.out.println(min + " " + max + " " + sum) System.out.println System.out System System.out min + " " + max + " " + sum " " max min + " " + max + " " + sum min " " max " " sum String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] a = new int[n];
        long max, min, sum = 0;
        ArrayList<Integer> z = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            z.add(scan.nextInt());
            sum += z.get(i);
//            a[i] = scan.nextInt();
        }
        max = Collections.max(z);
        min = Collections.min(z);

//        max = a[0];
//        min = a[0];

        /*for (int num : a) {
            if (max < num) {
                max = num;
            } else if (min > num) {
                min = num;
            }
            sum += num;
        }*/
        System.out.println(min + " " + max + " " + sum);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] a = new int[n];
        long max, min, sum = 0;
        ArrayList<Integer> z = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            z.add(scan.nextInt());
            sum += z.get(i);
//            a[i] = scan.nextInt();
        }
        max = Collections.max(z);
        min = Collections.min(z);

//        max = a[0];
//        min = a[0];

        /*for (int num : a) {
            if (max < num) {
                max = num;
            } else if (min > num) {
                min = num;
            }
            sum += num;
        }*/
        System.out.println(min + " " + max + " " + sum);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] a = new int[n];
        long max, min, sum = 0;
        ArrayList<Integer> z = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            z.add(scan.nextInt());
            sum += z.get(i);
//            a[i] = scan.nextInt();
        }
        max = Collections.max(z);
        min = Collections.min(z);

//        max = a[0];
//        min = a[0];

        /*for (int num : a) {
            if (max < num) {
                max = num;
            } else if (min > num) {
                min = num;
            }
            sum += num;
        }*/
        System.out.println(min + " " + max + " " + sum);
    }
}