import java.util.Scanner;

public class Main{
	public static void main(String[] args){
        
        Scanner sc = new Scanner(System.in);
        long a,b,i,total=0,max=0,min=0;

        a = sc.nextInt();
        for(i=0;i<a;i++){
        b = sc.nextInt();
        if(i==0){
            max=b;
            min=b;
        }
            if(max<b)max=b;
            if(min>b)min=b;
            total+=b;
        }
        System.out.println(min+" "+max+" "+total);
   }
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args){
        
        Scanner sc = new Scanner(System.in);
        long a,b,i,total=0,max=0,min=0;

        a = sc.nextInt();
        for(i=0;i<a;i++){
        b = sc.nextInt();
        if(i==0){
            max=b;
            min=b;
        }
            if(max<b)max=b;
            if(min>b)min=b;
            total+=b;
        }
        System.out.println(min+" "+max+" "+total);
   }
} Main public static void main(String[] args){
        
        Scanner sc = new Scanner(System.in);
        long a,b,i,total=0,max=0,min=0;

        a = sc.nextInt();
        for(i=0;i<a;i++){
        b = sc.nextInt();
        if(i==0){
            max=b;
            min=b;
        }
            if(max<b)max=b;
            if(min>b)min=b;
            total+=b;
        }
        System.out.println(min+" "+max+" "+total);
   } main {
        
        Scanner sc = new Scanner(System.in);
        long a,b,i,total=0,max=0,min=0;

        a = sc.nextInt();
        for(i=0;i<a;i++){
        b = sc.nextInt();
        if(i==0){
            max=b;
            min=b;
        }
            if(max<b)max=b;
            if(min>b)min=b;
            total+=b;
        }
        System.out.println(min+" "+max+" "+total);
   } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long a a b b i i total=0 total 0 max=0 max 0 min=0; min 0 a = sc.nextInt() a sc.nextInt() sc.nextInt sc for(i=0;i<a;i++){
        b = sc.nextInt();
        if(i==0){
            max=b;
            min=b;
        }
            if(max<b)max=b;
            if(min>b)min=b;
            total+=b;
        } i=0; i=0 i 0 i<a i a i++ i++ i {
        b = sc.nextInt();
        if(i==0){
            max=b;
            min=b;
        }
            if(max<b)max=b;
            if(min>b)min=b;
            total+=b;
        } {
        b = sc.nextInt();
        if(i==0){
            max=b;
            min=b;
        }
            if(max<b)max=b;
            if(min>b)min=b;
            total+=b;
        } b = sc.nextInt() b sc.nextInt() sc.nextInt sc if(i==0){
            max=b;
            min=b;
        } i==0 i 0 {
            max=b;
            min=b;
        } max=b max b min=b min b if(max<b)max=b; max<b max b max=b max b if(min>b)min=b; min>b min b min=b min b total+=b total b System.out.println(min+" "+max+" "+total) System.out.println System.out System System.out min+" "+max+" "+total " " max min+" "+max+" "+total min " " max " " total String[] args args public class Main{
	public static void main(String[] args){
        
        Scanner sc = new Scanner(System.in);
        long a,b,i,total=0,max=0,min=0;

        a = sc.nextInt();
        for(i=0;i<a;i++){
        b = sc.nextInt();
        if(i==0){
            max=b;
            min=b;
        }
            if(max<b)max=b;
            if(min>b)min=b;
            total+=b;
        }
        System.out.println(min+" "+max+" "+total);
   }
} public class Main{
	public static void main(String[] args){
        
        Scanner sc = new Scanner(System.in);
        long a,b,i,total=0,max=0,min=0;

        a = sc.nextInt();
        for(i=0;i<a;i++){
        b = sc.nextInt();
        if(i==0){
            max=b;
            min=b;
        }
            if(max<b)max=b;
            if(min>b)min=b;
            total+=b;
        }
        System.out.println(min+" "+max+" "+total);
   }
} Main
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
        
        Scanner sc = new Scanner(System.in);
        long a,b,i,total=0,max=0,min=0;

        a = sc.nextInt();
        for(i=0;i<a;i++){
        b = sc.nextInt();
        if(i==0){
            max=b;
            min=b;
        }
            if(max<b)max=b;
            if(min>b)min=b;
            total+=b;
        }
        System.out.println(min+" "+max+" "+total);
   }
}
