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



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

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();

		String[] arr = br.readLine().split(" ");



		int n = Integer.parseInt(str);
		int value = 0;


		int max=-2147483648;
		int min=2147483647;
		
		long sum = 0 ;
		for(int i=0;i<n;i++){
			value = Integer.parseInt(arr[i]);
			if(max<value){
				max=value;
			}
			if(min>value){
				min=value;
			}
			sum+=(long)value;
			
		}
		System.out.println(min +" "+ max +" "+sum);
	}



} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args) throws NumberFormatException, IOException{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();

		String[] arr = br.readLine().split(" ");



		int n = Integer.parseInt(str);
		int value = 0;


		int max=-2147483648;
		int min=2147483647;
		
		long sum = 0 ;
		for(int i=0;i<n;i++){
			value = Integer.parseInt(arr[i]);
			if(max<value){
				max=value;
			}
			if(min>value){
				min=value;
			}
			sum+=(long)value;
			
		}
		System.out.println(min +" "+ max +" "+sum);
	}



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

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();

		String[] arr = br.readLine().split(" ");



		int n = Integer.parseInt(str);
		int value = 0;


		int max=-2147483648;
		int min=2147483647;
		
		long sum = 0 ;
		for(int i=0;i<n;i++){
			value = Integer.parseInt(arr[i]);
			if(max<value){
				max=value;
			}
			if(min>value){
				min=value;
			}
			sum+=(long)value;
			
		}
		System.out.println(min +" "+ max +" "+sum);
	} main {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();

		String[] arr = br.readLine().split(" ");



		int n = Integer.parseInt(str);
		int value = 0;


		int max=-2147483648;
		int min=2147483647;
		
		long sum = 0 ;
		for(int i=0;i<n;i++){
			value = Integer.parseInt(arr[i]);
			if(max<value){
				max=value;
			}
			if(min>value){
				min=value;
			}
			sum+=(long)value;
			
		}
		System.out.println(min +" "+ max +" "+sum);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String str = br.readLine(); str br.readLine() br.readLine br String[] arr = br.readLine().split(" "); arr br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int n = Integer.parseInt(str); n Integer.parseInt(str) Integer.parseInt Integer str int value = 0; value 0 int max=-2147483648; max -2147483648 2147483648 int min=2147483647; min 2147483647 long sum = 0 ; sum 0 for(int i=0;i<n;i++){
			value = Integer.parseInt(arr[i]);
			if(max<value){
				max=value;
			}
			if(min>value){
				min=value;
			}
			sum+=(long)value;
			
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			value = Integer.parseInt(arr[i]);
			if(max<value){
				max=value;
			}
			if(min>value){
				min=value;
			}
			sum+=(long)value;
			
		} {
			value = Integer.parseInt(arr[i]);
			if(max<value){
				max=value;
			}
			if(min>value){
				min=value;
			}
			sum+=(long)value;
			
		} value = Integer.parseInt(arr[i]) value Integer.parseInt(arr[i]) Integer.parseInt Integer arr[i] arr i if(max<value){
				max=value;
			} max<value max value {
				max=value;
			} max=value max value if(min>value){
				min=value;
			} min>value min value {
				min=value;
			} min=value min value sum+=(long)value sum (long)value 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 public class Main {
	public static void main(String[] args) throws NumberFormatException, IOException{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();

		String[] arr = br.readLine().split(" ");



		int n = Integer.parseInt(str);
		int value = 0;


		int max=-2147483648;
		int min=2147483647;
		
		long sum = 0 ;
		for(int i=0;i<n;i++){
			value = Integer.parseInt(arr[i]);
			if(max<value){
				max=value;
			}
			if(min>value){
				min=value;
			}
			sum+=(long)value;
			
		}
		System.out.println(min +" "+ max +" "+sum);
	}



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

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();

		String[] arr = br.readLine().split(" ");



		int n = Integer.parseInt(str);
		int value = 0;


		int max=-2147483648;
		int min=2147483647;
		
		long sum = 0 ;
		for(int i=0;i<n;i++){
			value = Integer.parseInt(arr[i]);
			if(max<value){
				max=value;
			}
			if(min>value){
				min=value;
			}
			sum+=(long)value;
			
		}
		System.out.println(min +" "+ max +" "+sum);
	}



} Main

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



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

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();

		String[] arr = br.readLine().split(" ");



		int n = Integer.parseInt(str);
		int value = 0;


		int max=-2147483648;
		int min=2147483647;
		
		long sum = 0 ;
		for(int i=0;i<n;i++){
			value = Integer.parseInt(arr[i]);
			if(max<value){
				max=value;
			}
			if(min>value){
				min=value;
			}
			sum+=(long)value;
			
		}
		System.out.println(min +" "+ max +" "+sum);
	}



}