import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc =new Scanner(System.in);
        int n=sc.nextInt();
        int min=sc.nextInt();
        int max=min;
        long sum=min;
        n--;
        while(n>0){
            int tmp=sc.nextInt();
            if(min>tmp)min=tmp;
            if(max<tmp)max=tmp;
            sum+=tmp;
            n--;
        }
        System.out.println(min+" "+max+" "+sum);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args){
        Scanner sc =new Scanner(System.in);
        int n=sc.nextInt();
        int min=sc.nextInt();
        int max=min;
        long sum=min;
        n--;
        while(n>0){
            int tmp=sc.nextInt();
            if(min>tmp)min=tmp;
            if(max<tmp)max=tmp;
            sum+=tmp;
            n--;
        }
        System.out.println(min+" "+max+" "+sum);
    }
} Main public static void main(String[] args){
        Scanner sc =new Scanner(System.in);
        int n=sc.nextInt();
        int min=sc.nextInt();
        int max=min;
        long sum=min;
        n--;
        while(n>0){
            int tmp=sc.nextInt();
            if(min>tmp)min=tmp;
            if(max<tmp)max=tmp;
            sum+=tmp;
            n--;
        }
        System.out.println(min+" "+max+" "+sum);
    } main {
        Scanner sc =new Scanner(System.in);
        int n=sc.nextInt();
        int min=sc.nextInt();
        int max=min;
        long sum=min;
        n--;
        while(n>0){
            int tmp=sc.nextInt();
            if(min>tmp)min=tmp;
            if(max<tmp)max=tmp;
            sum+=tmp;
            n--;
        }
        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 int min=sc.nextInt(); min sc.nextInt() sc.nextInt sc int max=min; max min long sum=min; sum min n-- n while(n>0){
            int tmp=sc.nextInt();
            if(min>tmp)min=tmp;
            if(max<tmp)max=tmp;
            sum+=tmp;
            n--;
        } n>0 n 0 {
            int tmp=sc.nextInt();
            if(min>tmp)min=tmp;
            if(max<tmp)max=tmp;
            sum+=tmp;
            n--;
        } int tmp=sc.nextInt(); tmp sc.nextInt() sc.nextInt sc if(min>tmp)min=tmp; min>tmp min tmp min=tmp min tmp if(max<tmp)max=tmp; max<tmp max tmp max=tmp max tmp sum+=tmp sum tmp n-- n 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 sc =new Scanner(System.in);
        int n=sc.nextInt();
        int min=sc.nextInt();
        int max=min;
        long sum=min;
        n--;
        while(n>0){
            int tmp=sc.nextInt();
            if(min>tmp)min=tmp;
            if(max<tmp)max=tmp;
            sum+=tmp;
            n--;
        }
        System.out.println(min+" "+max+" "+sum);
    }
} public class Main {
    public static void main(String[] args){
        Scanner sc =new Scanner(System.in);
        int n=sc.nextInt();
        int min=sc.nextInt();
        int max=min;
        long sum=min;
        n--;
        while(n>0){
            int tmp=sc.nextInt();
            if(min>tmp)min=tmp;
            if(max<tmp)max=tmp;
            sum+=tmp;
            n--;
        }
        System.out.println(min+" "+max+" "+sum);
    }
} Main
import java.util.Scanner;

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