import java.io.*;
import java.util.*;


class Main {
	public static void main(String[] args) throws IOException {

		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n =Integer.parseInt(br.readLine());
		
		
		int max = Integer.MIN_VALUE;
		int min = Integer.MAX_VALUE;
		long sum = 0;
		String[] cut = br.readLine().split(" ");
		
		for (int i=0;i<n;i++) {
			int r =Integer.parseInt(cut[i]);
			if(max<r){
				max=r;
			}
			if(min>r){
				min=r;
			}
			sum+=r;
		}	
		System.out.println(min+" "+max+" "+sum);
	
		

	}
} import java.io.*; io.* java import java.util.*; util.* java class Main {
	public static void main(String[] args) throws IOException {

		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n =Integer.parseInt(br.readLine());
		
		
		int max = Integer.MIN_VALUE;
		int min = Integer.MAX_VALUE;
		long sum = 0;
		String[] cut = br.readLine().split(" ");
		
		for (int i=0;i<n;i++) {
			int r =Integer.parseInt(cut[i]);
			if(max<r){
				max=r;
			}
			if(min>r){
				min=r;
			}
			sum+=r;
		}	
		System.out.println(min+" "+max+" "+sum);
	
		

	}
} Main public static void main(String[] args) throws IOException {

		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n =Integer.parseInt(br.readLine());
		
		
		int max = Integer.MIN_VALUE;
		int min = Integer.MAX_VALUE;
		long sum = 0;
		String[] cut = br.readLine().split(" ");
		
		for (int i=0;i<n;i++) {
			int r =Integer.parseInt(cut[i]);
			if(max<r){
				max=r;
			}
			if(min>r){
				min=r;
			}
			sum+=r;
		}	
		System.out.println(min+" "+max+" "+sum);
	
		

	} main {

		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n =Integer.parseInt(br.readLine());
		
		
		int max = Integer.MIN_VALUE;
		int min = Integer.MAX_VALUE;
		long sum = 0;
		String[] cut = br.readLine().split(" ");
		
		for (int i=0;i<n;i++) {
			int r =Integer.parseInt(cut[i]);
			if(max<r){
				max=r;
			}
			if(min>r){
				min=r;
			}
			sum+=r;
		}	
		System.out.println(min+" "+max+" "+sum);
	
		

	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n =Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int max = Integer.MIN_VALUE; max Integer.MIN_VALUE Integer Integer.MIN_VALUE int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE long sum = 0; sum 0 String[] cut = br.readLine().split(" "); cut br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " for (int i=0;i<n;i++) {
			int r =Integer.parseInt(cut[i]);
			if(max<r){
				max=r;
			}
			if(min>r){
				min=r;
			}
			sum+=r;
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			int r =Integer.parseInt(cut[i]);
			if(max<r){
				max=r;
			}
			if(min>r){
				min=r;
			}
			sum+=r;
		} {
			int r =Integer.parseInt(cut[i]);
			if(max<r){
				max=r;
			}
			if(min>r){
				min=r;
			}
			sum+=r;
		} int r =Integer.parseInt(cut[i]); r Integer.parseInt(cut[i]) Integer.parseInt Integer cut[i] cut i if(max<r){
				max=r;
			} max<r max r {
				max=r;
			} max=r max r if(min>r){
				min=r;
			} min>r min r {
				min=r;
			} min=r min r sum+=r sum r 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.io.*;
import java.util.*;


class Main {
	public static void main(String[] args) throws IOException {

		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n =Integer.parseInt(br.readLine());
		
		
		int max = Integer.MIN_VALUE;
		int min = Integer.MAX_VALUE;
		long sum = 0;
		String[] cut = br.readLine().split(" ");
		
		for (int i=0;i<n;i++) {
			int r =Integer.parseInt(cut[i]);
			if(max<r){
				max=r;
			}
			if(min>r){
				min=r;
			}
			sum+=r;
		}	
		System.out.println(min+" "+max+" "+sum);
	
		

	}
}