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