import java.util.Scanner;
  
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n, i;
        long min, max;
        long sum = 0;
        n = sc.nextInt();
        long[] a = new long[n];

        for(i = 0; i < a.length; i++){
            a[i] = sc.nextLong();
            sum += a[i];
        }

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

        for(i = 0; i < a.length; i++){
            min = Math.min(min, a[i]);
            max = Math.max(max, a[i]);
        }
        System.out.println(min + " " + max + " " + sum);
        sc.close();
    }
}

 import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n, i;
        long min, max;
        long sum = 0;
        n = sc.nextInt();
        long[] a = new long[n];

        for(i = 0; i < a.length; i++){
            a[i] = sc.nextLong();
            sum += a[i];
        }

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

        for(i = 0; i < a.length; i++){
            min = Math.min(min, a[i]);
            max = Math.max(max, a[i]);
        }
        System.out.println(min + " " + max + " " + sum);
        sc.close();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n, i;
        long min, max;
        long sum = 0;
        n = sc.nextInt();
        long[] a = new long[n];

        for(i = 0; i < a.length; i++){
            a[i] = sc.nextLong();
            sum += a[i];
        }

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

        for(i = 0; i < a.length; i++){
            min = Math.min(min, a[i]);
            max = Math.max(max, a[i]);
        }
        System.out.println(min + " " + max + " " + sum);
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int n, i;
        long min, max;
        long sum = 0;
        n = sc.nextInt();
        long[] a = new long[n];

        for(i = 0; i < a.length; i++){
            a[i] = sc.nextLong();
            sum += a[i];
        }

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

        for(i = 0; i < a.length; i++){
            min = Math.min(min, a[i]);
            max = Math.max(max, a[i]);
        }
        System.out.println(min + " " + max + " " + sum);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n n i; i long min min max; max long sum = 0; sum 0 n = sc.nextInt() n sc.nextInt() sc.nextInt sc long[] a = new long[n]; a new long[n] n for(i = 0; i < a.length; i++){
            a[i] = sc.nextLong();
            sum += a[i];
        } i = 0; i = 0 i 0 i < a.length i a.length a a.length i++ i++ i {
            a[i] = sc.nextLong();
            sum += a[i];
        } {
            a[i] = sc.nextLong();
            sum += a[i];
        } a[i] = sc.nextLong() a[i] a i sc.nextLong() sc.nextLong sc sum += a[i] sum a[i] a i min = a[0] min a[0] a 0 max = a[0] max a[0] a 0 for(i = 0; i < a.length; i++){
            min = Math.min(min, a[i]);
            max = Math.max(max, a[i]);
        } i = 0; i = 0 i 0 i < a.length i a.length a a.length i++ i++ i {
            min = Math.min(min, a[i]);
            max = Math.max(max, a[i]);
        } {
            min = Math.min(min, a[i]);
            max = Math.max(max, a[i]);
        } min = Math.min(min, a[i]) min Math.min(min, a[i]) Math.min Math min a[i] a i max = Math.max(max, a[i]) max Math.max(max, a[i]) Math.max Math max a[i] a i System.out.println(min + " " + max + " " + sum) System.out.println System.out System System.out min + " " + max + " " + sum " " max min + " " + max + " " + sum min " " max " " sum sc.close() sc.close sc String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n, i;
        long min, max;
        long sum = 0;
        n = sc.nextInt();
        long[] a = new long[n];

        for(i = 0; i < a.length; i++){
            a[i] = sc.nextLong();
            sum += a[i];
        }

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

        for(i = 0; i < a.length; i++){
            min = Math.min(min, a[i]);
            max = Math.max(max, a[i]);
        }
        System.out.println(min + " " + max + " " + sum);
        sc.close();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n, i;
        long min, max;
        long sum = 0;
        n = sc.nextInt();
        long[] a = new long[n];

        for(i = 0; i < a.length; i++){
            a[i] = sc.nextLong();
            sum += a[i];
        }

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

        for(i = 0; i < a.length; i++){
            min = Math.min(min, a[i]);
            max = Math.max(max, a[i]);
        }
        System.out.println(min + " " + max + " " + sum);
        sc.close();
    }
} Main
import java.util.Scanner;
  
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n, i;
        long min, max;
        long sum = 0;
        n = sc.nextInt();
        long[] a = new long[n];

        for(i = 0; i < a.length; i++){
            a[i] = sc.nextLong();
            sum += a[i];
        }

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

        for(i = 0; i < a.length; i++){
            min = Math.min(min, a[i]);
            max = Math.max(max, a[i]);
        }
        System.out.println(min + " " + max + " " + sum);
        sc.close();
    }
}


