import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] a = new int[n];
		
		for(int i = 0 ; i<n ; i++){
			a[i]=scan.nextInt();
		}

		
		int min = a[0];
		int max = a[0];
		long sum = 0;
		
		for(int i = 0 ; i<n ; i++){
			sum = sum + a[i];
			if(a[i]<min)min=a[i];
			if(a[i]>max)max=a[i];
		}
	
		System.out.println(min+" "+max+" "+sum);
	
	
	}
	
	

	
	
	
	static void swap(int[] a,int[] b,int i){
		int tmp =a[i];
		a[i]=b[i];
		b[i]=tmp;
		return;
	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] a = new int[n];
		
		for(int i = 0 ; i<n ; i++){
			a[i]=scan.nextInt();
		}

		
		int min = a[0];
		int max = a[0];
		long sum = 0;
		
		for(int i = 0 ; i<n ; i++){
			sum = sum + a[i];
			if(a[i]<min)min=a[i];
			if(a[i]>max)max=a[i];
		}
	
		System.out.println(min+" "+max+" "+sum);
	
	
	}
	
	

	
	
	
	static void swap(int[] a,int[] b,int i){
		int tmp =a[i];
		a[i]=b[i];
		b[i]=tmp;
		return;
	}

} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] a = new int[n];
		
		for(int i = 0 ; i<n ; i++){
			a[i]=scan.nextInt();
		}

		
		int min = a[0];
		int max = a[0];
		long sum = 0;
		
		for(int i = 0 ; i<n ; i++){
			sum = sum + a[i];
			if(a[i]<min)min=a[i];
			if(a[i]>max)max=a[i];
		}
	
		System.out.println(min+" "+max+" "+sum);
	
	
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] a = new int[n];
		
		for(int i = 0 ; i<n ; i++){
			a[i]=scan.nextInt();
		}

		
		int min = a[0];
		int max = a[0];
		long sum = 0;
		
		for(int i = 0 ; i<n ; i++){
			sum = sum + a[i];
			if(a[i]<min)min=a[i];
			if(a[i]>max)max=a[i];
		}
	
		System.out.println(min+" "+max+" "+sum);
	
	
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int[] a = new int[n]; a new int[n] n for(int i = 0 ; i<n ; i++){
			a[i]=scan.nextInt();
		} int i = 0 ; int i = 0 ; i 0 i<n i n i++ i++ i {
			a[i]=scan.nextInt();
		} {
			a[i]=scan.nextInt();
		} a[i]=scan.nextInt() a[i] a i scan.nextInt() scan.nextInt scan int min = a[0]; min a[0] a 0 int max = a[0]; max a[0] a 0 long sum = 0; sum 0 for(int i = 0 ; i<n ; i++){
			sum = sum + a[i];
			if(a[i]<min)min=a[i];
			if(a[i]>max)max=a[i];
		} int i = 0 ; int i = 0 ; i 0 i<n i n i++ i++ i {
			sum = sum + a[i];
			if(a[i]<min)min=a[i];
			if(a[i]>max)max=a[i];
		} {
			sum = sum + a[i];
			if(a[i]<min)min=a[i];
			if(a[i]>max)max=a[i];
		} sum = sum + a[i] sum sum + a[i] sum a[i] a i if(a[i]<min)min=a[i]; a[i]<min a[i] a i min min=a[i] min a[i] a i if(a[i]>max)max=a[i]; a[i]>max a[i] a i max max=a[i] max a[i] a 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 static void swap(int[] a,int[] b,int i){
		int tmp =a[i];
		a[i]=b[i];
		b[i]=tmp;
		return;
	} swap {
		int tmp =a[i];
		a[i]=b[i];
		b[i]=tmp;
		return;
	} int tmp =a[i]; tmp a[i] a i a[i]=b[i] a[i] a i b[i] b i b[i]=tmp b[i] b i tmp return; int[] a a int[] b b int i i public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] a = new int[n];
		
		for(int i = 0 ; i<n ; i++){
			a[i]=scan.nextInt();
		}

		
		int min = a[0];
		int max = a[0];
		long sum = 0;
		
		for(int i = 0 ; i<n ; i++){
			sum = sum + a[i];
			if(a[i]<min)min=a[i];
			if(a[i]>max)max=a[i];
		}
	
		System.out.println(min+" "+max+" "+sum);
	
	
	}
	
	

	
	
	
	static void swap(int[] a,int[] b,int i){
		int tmp =a[i];
		a[i]=b[i];
		b[i]=tmp;
		return;
	}

} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] a = new int[n];
		
		for(int i = 0 ; i<n ; i++){
			a[i]=scan.nextInt();
		}

		
		int min = a[0];
		int max = a[0];
		long sum = 0;
		
		for(int i = 0 ; i<n ; i++){
			sum = sum + a[i];
			if(a[i]<min)min=a[i];
			if(a[i]>max)max=a[i];
		}
	
		System.out.println(min+" "+max+" "+sum);
	
	
	}
	
	

	
	
	
	static void swap(int[] a,int[] b,int i){
		int tmp =a[i];
		a[i]=b[i];
		b[i]=tmp;
		return;
	}

} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] a = new int[n];
		
		for(int i = 0 ; i<n ; i++){
			a[i]=scan.nextInt();
		}

		
		int min = a[0];
		int max = a[0];
		long sum = 0;
		
		for(int i = 0 ; i<n ; i++){
			sum = sum + a[i];
			if(a[i]<min)min=a[i];
			if(a[i]>max)max=a[i];
		}
	
		System.out.println(min+" "+max+" "+sum);
	
	
	}
	
	

	
	
	
	static void swap(int[] a,int[] b,int i){
		int tmp =a[i];
		a[i]=b[i];
		b[i]=tmp;
		return;
	}

}