import java.util.Scanner;
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long Max = -10000001;
        long Min = 10000000;
        long Sum = 0;
            for(int i=0;i<n;i++){
                long a = sc.nextLong();
                Sum += a;
                if(Max<a){
                    Max = a;
                }
                if(Min>a){
                    Min = a;
                }
            }
        System.out.println(Min + " " + Max + " " + Sum);
    }
} import java.util.Scanner; Scanner java.util class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long Max = -10000001;
        long Min = 10000000;
        long Sum = 0;
            for(int i=0;i<n;i++){
                long a = sc.nextLong();
                Sum += a;
                if(Max<a){
                    Max = a;
                }
                if(Min>a){
                    Min = a;
                }
            }
        System.out.println(Min + " " + Max + " " + Sum);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long Max = -10000001;
        long Min = 10000000;
        long Sum = 0;
            for(int i=0;i<n;i++){
                long a = sc.nextLong();
                Sum += a;
                if(Max<a){
                    Max = a;
                }
                if(Min>a){
                    Min = a;
                }
            }
        System.out.println(Min + " " + Max + " " + Sum);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long Max = -10000001;
        long Min = 10000000;
        long Sum = 0;
            for(int i=0;i<n;i++){
                long a = sc.nextLong();
                Sum += a;
                if(Max<a){
                    Max = a;
                }
                if(Min>a){
                    Min = a;
                }
            }
        System.out.println(Min + " " + Max + " " + Sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc long Max = -10000001; Max -10000001 10000001 long Min = 10000000; Min 10000000 long Sum = 0; Sum 0 for(int i=0;i<n;i++){
                long a = sc.nextLong();
                Sum += a;
                if(Max<a){
                    Max = a;
                }
                if(Min>a){
                    Min = a;
                }
            } int i=0; int i=0; i 0 i<n i n i++ i++ i {
                long a = sc.nextLong();
                Sum += a;
                if(Max<a){
                    Max = a;
                }
                if(Min>a){
                    Min = a;
                }
            } {
                long a = sc.nextLong();
                Sum += a;
                if(Max<a){
                    Max = a;
                }
                if(Min>a){
                    Min = a;
                }
            } long a = sc.nextLong(); a sc.nextLong() sc.nextLong sc Sum += a Sum a if(Max<a){
                    Max = a;
                } Max<a Max a {
                    Max = a;
                } Max = a Max a if(Min>a){
                    Min = a;
                } Min>a Min a {
                    Min = a;
                } Min = a Min a 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
import java.util.Scanner;
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long Max = -10000001;
        long Min = 10000000;
        long Sum = 0;
            for(int i=0;i<n;i++){
                long a = sc.nextLong();
                Sum += a;
                if(Max<a){
                    Max = a;
                }
                if(Min>a){
                    Min = a;
                }
            }
        System.out.println(Min + " " + Max + " " + Sum);
    }
}
