import java.io.*;
import java.util.*;

class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int[] array = new int[n];
        
        for (int i = 0; i < n ; i++) {
            array[i] = sc.nextInt();
        }
        
        int max = array[0];
        int min = array[0];
        long sum = 0;
        
        for (int i = 0; i < n; i++) {
            if (max < array[i]) {
                max = array[i];
            }
            if (min > array[i]) {
                min = array[i];
            }
            sum += array[i];
        }
        
        System.out.printf("%d %d %d\n", min, max, sum);
    }
} import java.io.*; io.* java import java.util.*; util.* java class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int[] array = new int[n];
        
        for (int i = 0; i < n ; i++) {
            array[i] = sc.nextInt();
        }
        
        int max = array[0];
        int min = array[0];
        long sum = 0;
        
        for (int i = 0; i < n; i++) {
            if (max < array[i]) {
                max = array[i];
            }
            if (min > array[i]) {
                min = array[i];
            }
            sum += array[i];
        }
        
        System.out.printf("%d %d %d\n", min, max, sum);
    }
} Main public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int[] array = new int[n];
        
        for (int i = 0; i < n ; i++) {
            array[i] = sc.nextInt();
        }
        
        int max = array[0];
        int min = array[0];
        long sum = 0;
        
        for (int i = 0; i < n; i++) {
            if (max < array[i]) {
                max = array[i];
            }
            if (min > array[i]) {
                min = array[i];
            }
            sum += array[i];
        }
        
        System.out.printf("%d %d %d\n", min, max, sum);
    } main {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int[] array = new int[n];
        
        for (int i = 0; i < n ; i++) {
            array[i] = sc.nextInt();
        }
        
        int max = array[0];
        int min = array[0];
        long sum = 0;
        
        for (int i = 0; i < n; i++) {
            if (max < array[i]) {
                max = array[i];
            }
            if (min > array[i]) {
                min = array[i];
            }
            sum += array[i];
        }
        
        System.out.printf("%d %d %d\n", min, max, sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] array = new int[n]; array new int[n] n for (int i = 0; i < n ; i++) {
            array[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            array[i] = sc.nextInt();
        } {
            array[i] = sc.nextInt();
        } array[i] = sc.nextInt() array[i] array i sc.nextInt() sc.nextInt sc int max = array[0]; max array[0] array 0 int min = array[0]; min array[0] array 0 long sum = 0; sum 0 for (int i = 0; i < n; i++) {
            if (max < array[i]) {
                max = array[i];
            }
            if (min > array[i]) {
                min = array[i];
            }
            sum += array[i];
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            if (max < array[i]) {
                max = array[i];
            }
            if (min > array[i]) {
                min = array[i];
            }
            sum += array[i];
        } {
            if (max < array[i]) {
                max = array[i];
            }
            if (min > array[i]) {
                min = array[i];
            }
            sum += array[i];
        } if (max < array[i]) {
                max = array[i];
            } max < array[i] max array[i] array i {
                max = array[i];
            } max = array[i] max array[i] array i if (min > array[i]) {
                min = array[i];
            } min > array[i] min array[i] array i {
                min = array[i];
            } min = array[i] min array[i] array i sum += array[i] sum array[i] array i System.out.printf("%d %d %d\n", min, max, sum) System.out.printf System.out System System.out "%d %d %d\n" min max sum String[] args args
import java.io.*;
import java.util.*;

class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int[] array = new int[n];
        
        for (int i = 0; i < n ; i++) {
            array[i] = sc.nextInt();
        }
        
        int max = array[0];
        int min = array[0];
        long sum = 0;
        
        for (int i = 0; i < n; i++) {
            if (max < array[i]) {
                max = array[i];
            }
            if (min > array[i]) {
                min = array[i];
            }
            sum += array[i];
        }
        
        System.out.printf("%d %d %d\n", min, max, sum);
    }
}