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