import java.util.*;

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

class Main{
    public static void main(String[] args){
    	Scanner sc= new Scanner(System.in);
    	int max=-1000000,min=1000000,get=0;
    	long sum=0;
    	int i=sc.nextInt();
    	for(;i>0;i--){
    		get=sc.nextInt();
    		max=Math.max(max, get);
    		min=Math.min(min, get);
    		sum+=get;
    	}
    	System.out.println(min+" "+max+" "+sum);
    }
}