import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        boolean first=true;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int[] x;
            while ((line = br.readLine()) != null) {
            	int n=Integer.parseInt(line);
            	String[] str=br.readLine().split(" ");
            	
            	x=new int[n];
            	long max=Integer.parseInt(str[0]);
            	long min=Integer.parseInt(str[0]);
            	long sum=0;
            	
            	for(int i=0;i<n;i++){
            		x[i]=Integer.parseInt(str[i]);
            		if(max<x[i]){
            			max=x[i];
            		}
            		if(min>x[i]){
            			min=x[i];
            		}
            		sum+=x[i];
            	}
            	System.out.println(min+" "+max+" "+sum);
            	break;
            }
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        boolean first=true;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int[] x;
            while ((line = br.readLine()) != null) {
            	int n=Integer.parseInt(line);
            	String[] str=br.readLine().split(" ");
            	
            	x=new int[n];
            	long max=Integer.parseInt(str[0]);
            	long min=Integer.parseInt(str[0]);
            	long sum=0;
            	
            	for(int i=0;i<n;i++){
            		x[i]=Integer.parseInt(str[i]);
            		if(max<x[i]){
            			max=x[i];
            		}
            		if(min>x[i]){
            			min=x[i];
            		}
            		sum+=x[i];
            	}
            	System.out.println(min+" "+max+" "+sum);
            	break;
            }
        }
    }
} Main public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        boolean first=true;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int[] x;
            while ((line = br.readLine()) != null) {
            	int n=Integer.parseInt(line);
            	String[] str=br.readLine().split(" ");
            	
            	x=new int[n];
            	long max=Integer.parseInt(str[0]);
            	long min=Integer.parseInt(str[0]);
            	long sum=0;
            	
            	for(int i=0;i<n;i++){
            		x[i]=Integer.parseInt(str[i]);
            		if(max<x[i]){
            			max=x[i];
            		}
            		if(min>x[i]){
            			min=x[i];
            		}
            		sum+=x[i];
            	}
            	System.out.println(min+" "+max+" "+sum);
            	break;
            }
        }
    } main {
        // TODO ?????????????????????????????????????????????
        
        boolean first=true;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int[] x;
            while ((line = br.readLine()) != null) {
            	int n=Integer.parseInt(line);
            	String[] str=br.readLine().split(" ");
            	
            	x=new int[n];
            	long max=Integer.parseInt(str[0]);
            	long min=Integer.parseInt(str[0]);
            	long sum=0;
            	
            	for(int i=0;i<n;i++){
            		x[i]=Integer.parseInt(str[i]);
            		if(max<x[i]){
            			max=x[i];
            		}
            		if(min>x[i]){
            			min=x[i];
            		}
            		sum+=x[i];
            	}
            	System.out.println(min+" "+max+" "+sum);
            	break;
            }
        }
    } boolean first=true; first true try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int[] x;
            while ((line = br.readLine()) != null) {
            	int n=Integer.parseInt(line);
            	String[] str=br.readLine().split(" ");
            	
            	x=new int[n];
            	long max=Integer.parseInt(str[0]);
            	long min=Integer.parseInt(str[0]);
            	long sum=0;
            	
            	for(int i=0;i<n;i++){
            		x[i]=Integer.parseInt(str[i]);
            		if(max<x[i]){
            			max=x[i];
            		}
            		if(min>x[i]){
            			min=x[i];
            		}
            		sum+=x[i];
            	}
            	System.out.println(min+" "+max+" "+sum);
            	break;
            }
        } {
            String line;
            int[] x;
            while ((line = br.readLine()) != null) {
            	int n=Integer.parseInt(line);
            	String[] str=br.readLine().split(" ");
            	
            	x=new int[n];
            	long max=Integer.parseInt(str[0]);
            	long min=Integer.parseInt(str[0]);
            	long sum=0;
            	
            	for(int i=0;i<n;i++){
            		x[i]=Integer.parseInt(str[i]);
            		if(max<x[i]){
            			max=x[i];
            		}
            		if(min>x[i]){
            			min=x[i];
            		}
            		sum+=x[i];
            	}
            	System.out.println(min+" "+max+" "+sum);
            	break;
            }
        } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) String line; line int[] x; x while ((line = br.readLine()) != null) {
            	int n=Integer.parseInt(line);
            	String[] str=br.readLine().split(" ");
            	
            	x=new int[n];
            	long max=Integer.parseInt(str[0]);
            	long min=Integer.parseInt(str[0]);
            	long sum=0;
            	
            	for(int i=0;i<n;i++){
            		x[i]=Integer.parseInt(str[i]);
            		if(max<x[i]){
            			max=x[i];
            		}
            		if(min>x[i]){
            			min=x[i];
            		}
            		sum+=x[i];
            	}
            	System.out.println(min+" "+max+" "+sum);
            	break;
            } (line = br.readLine()) != null (line = br.readLine()) line br.readLine() br.readLine br null {
            	int n=Integer.parseInt(line);
            	String[] str=br.readLine().split(" ");
            	
            	x=new int[n];
            	long max=Integer.parseInt(str[0]);
            	long min=Integer.parseInt(str[0]);
            	long sum=0;
            	
            	for(int i=0;i<n;i++){
            		x[i]=Integer.parseInt(str[i]);
            		if(max<x[i]){
            			max=x[i];
            		}
            		if(min>x[i]){
            			min=x[i];
            		}
            		sum+=x[i];
            	}
            	System.out.println(min+" "+max+" "+sum);
            	break;
            } int n=Integer.parseInt(line); n Integer.parseInt(line) Integer.parseInt Integer line String[] str=br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " x=new int[n] x new int[n] n long max=Integer.parseInt(str[0]); max Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 long min=Integer.parseInt(str[0]); min Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 long sum=0; sum 0 for(int i=0;i<n;i++){
            		x[i]=Integer.parseInt(str[i]);
            		if(max<x[i]){
            			max=x[i];
            		}
            		if(min>x[i]){
            			min=x[i];
            		}
            		sum+=x[i];
            	} int i=0; int i=0; i 0 i<n i n i++ i++ i {
            		x[i]=Integer.parseInt(str[i]);
            		if(max<x[i]){
            			max=x[i];
            		}
            		if(min>x[i]){
            			min=x[i];
            		}
            		sum+=x[i];
            	} {
            		x[i]=Integer.parseInt(str[i]);
            		if(max<x[i]){
            			max=x[i];
            		}
            		if(min>x[i]){
            			min=x[i];
            		}
            		sum+=x[i];
            	} x[i]=Integer.parseInt(str[i]) x[i] x i Integer.parseInt(str[i]) Integer.parseInt Integer str[i] str i if(max<x[i]){
            			max=x[i];
            		} max<x[i] max x[i] x i {
            			max=x[i];
            		} max=x[i] max x[i] x i if(min>x[i]){
            			min=x[i];
            		} min>x[i] min x[i] x i {
            			min=x[i];
            		} min=x[i] min x[i] x i sum+=x[i] sum x[i] x 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 break; String[] args args public class Main {

	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        boolean first=true;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int[] x;
            while ((line = br.readLine()) != null) {
            	int n=Integer.parseInt(line);
            	String[] str=br.readLine().split(" ");
            	
            	x=new int[n];
            	long max=Integer.parseInt(str[0]);
            	long min=Integer.parseInt(str[0]);
            	long sum=0;
            	
            	for(int i=0;i<n;i++){
            		x[i]=Integer.parseInt(str[i]);
            		if(max<x[i]){
            			max=x[i];
            		}
            		if(min>x[i]){
            			min=x[i];
            		}
            		sum+=x[i];
            	}
            	System.out.println(min+" "+max+" "+sum);
            	break;
            }
        }
    }
} public class Main {

	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        boolean first=true;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int[] x;
            while ((line = br.readLine()) != null) {
            	int n=Integer.parseInt(line);
            	String[] str=br.readLine().split(" ");
            	
            	x=new int[n];
            	long max=Integer.parseInt(str[0]);
            	long min=Integer.parseInt(str[0]);
            	long sum=0;
            	
            	for(int i=0;i<n;i++){
            		x[i]=Integer.parseInt(str[i]);
            		if(max<x[i]){
            			max=x[i];
            		}
            		if(min>x[i]){
            			min=x[i];
            		}
            		sum+=x[i];
            	}
            	System.out.println(min+" "+max+" "+sum);
            	break;
            }
        }
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        boolean first=true;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int[] x;
            while ((line = br.readLine()) != null) {
            	int n=Integer.parseInt(line);
            	String[] str=br.readLine().split(" ");
            	
            	x=new int[n];
            	long max=Integer.parseInt(str[0]);
            	long min=Integer.parseInt(str[0]);
            	long sum=0;
            	
            	for(int i=0;i<n;i++){
            		x[i]=Integer.parseInt(str[i]);
            		if(max<x[i]){
            			max=x[i];
            		}
            		if(min>x[i]){
            			min=x[i];
            		}
            		sum+=x[i];
            	}
            	System.out.println(min+" "+max+" "+sum);
            	break;
            }
        }
    }
}