
import java.io.PrintStream;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int max = -1000001;
        int min = 1000001;
        long sum = 0;
        int n = scanner.nextInt();
        int i= 0;
        while(i < n){
            int x = scanner.nextInt();
            sum += x;
            if( max < x ){
                max = x;
            }
            if(min > x){
                min = x;
            }
            i++;
        }
        System.out.println(min+" "+max+" "+sum);
    }
}
 import java.io.PrintStream; PrintStream java.io import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int max = -1000001;
        int min = 1000001;
        long sum = 0;
        int n = scanner.nextInt();
        int i= 0;
        while(i < n){
            int x = scanner.nextInt();
            sum += x;
            if( max < x ){
                max = x;
            }
            if(min > x){
                min = x;
            }
            i++;
        }
        System.out.println(min+" "+max+" "+sum);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int max = -1000001;
        int min = 1000001;
        long sum = 0;
        int n = scanner.nextInt();
        int i= 0;
        while(i < n){
            int x = scanner.nextInt();
            sum += x;
            if( max < x ){
                max = x;
            }
            if(min > x){
                min = x;
            }
            i++;
        }
        System.out.println(min+" "+max+" "+sum);
    } main {
        Scanner scanner = new Scanner(System.in);

        int max = -1000001;
        int min = 1000001;
        long sum = 0;
        int n = scanner.nextInt();
        int i= 0;
        while(i < n){
            int x = scanner.nextInt();
            sum += x;
            if( max < x ){
                max = x;
            }
            if(min > x){
                min = x;
            }
            i++;
        }
        System.out.println(min+" "+max+" "+sum);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int max = -1000001; max -1000001 1000001 int min = 1000001; min 1000001 long sum = 0; sum 0 int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int i= 0; i 0 while(i < n){
            int x = scanner.nextInt();
            sum += x;
            if( max < x ){
                max = x;
            }
            if(min > x){
                min = x;
            }
            i++;
        } i < n i n {
            int x = scanner.nextInt();
            sum += x;
            if( max < x ){
                max = x;
            }
            if(min > x){
                min = x;
            }
            i++;
        } int x = scanner.nextInt(); x scanner.nextInt() scanner.nextInt scanner sum += x sum x if( max < x ){
                max = x;
            } max < x max x {
                max = x;
            } max = x max x if(min > x){
                min = x;
            } min > x min x {
                min = x;
            } min = x min x i++ 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 String[] args args public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int max = -1000001;
        int min = 1000001;
        long sum = 0;
        int n = scanner.nextInt();
        int i= 0;
        while(i < n){
            int x = scanner.nextInt();
            sum += x;
            if( max < x ){
                max = x;
            }
            if(min > x){
                min = x;
            }
            i++;
        }
        System.out.println(min+" "+max+" "+sum);
    }
} public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int max = -1000001;
        int min = 1000001;
        long sum = 0;
        int n = scanner.nextInt();
        int i= 0;
        while(i < n){
            int x = scanner.nextInt();
            sum += x;
            if( max < x ){
                max = x;
            }
            if(min > x){
                min = x;
            }
            i++;
        }
        System.out.println(min+" "+max+" "+sum);
    }
} Main

import java.io.PrintStream;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int max = -1000001;
        int min = 1000001;
        long sum = 0;
        int n = scanner.nextInt();
        int i= 0;
        while(i < n){
            int x = scanner.nextInt();
            sum += x;
            if( max < x ){
                max = x;
            }
            if(min > x){
                min = x;
            }
            i++;
        }
        System.out.println(min+" "+max+" "+sum);
    }
}

