import java.util.Scanner;

class Main{
	@SuppressWarnings("resource")
	public static void main(String[] args) {
		//??\????????£?¨?
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] hako = new int[n];
		long sum = 0;
		int max = -1000000;
		int min = 1000000;

		for(int i = 0; i < n; i++){
			hako[i] = scan.nextInt();
			sum = sum + hako[i];
		}
		
		//??\?????????

		for (int i=0; i<hako.length; i++) {
			if (max < hako[i]) {
				max = hako[i];
			}
			if (min > hako[i]) {
				min = hako[i];
			}
		}
		 
		//??????
		System.out.println(min + " " + max + " " + sum);
	}
} import java.util.Scanner; Scanner java.util class Main{
	@SuppressWarnings("resource")
	public static void main(String[] args) {
		//??\????????£?¨?
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] hako = new int[n];
		long sum = 0;
		int max = -1000000;
		int min = 1000000;

		for(int i = 0; i < n; i++){
			hako[i] = scan.nextInt();
			sum = sum + hako[i];
		}
		
		//??\?????????

		for (int i=0; i<hako.length; i++) {
			if (max < hako[i]) {
				max = hako[i];
			}
			if (min > hako[i]) {
				min = hako[i];
			}
		}
		 
		//??????
		System.out.println(min + " " + max + " " + sum);
	}
} Main @SuppressWarnings("resource")
	public static void main(String[] args) {
		//??\????????£?¨?
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] hako = new int[n];
		long sum = 0;
		int max = -1000000;
		int min = 1000000;

		for(int i = 0; i < n; i++){
			hako[i] = scan.nextInt();
			sum = sum + hako[i];
		}
		
		//??\?????????

		for (int i=0; i<hako.length; i++) {
			if (max < hako[i]) {
				max = hako[i];
			}
			if (min > hako[i]) {
				min = hako[i];
			}
		}
		 
		//??????
		System.out.println(min + " " + max + " " + sum);
	} main {
		//??\????????£?¨?
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] hako = new int[n];
		long sum = 0;
		int max = -1000000;
		int min = 1000000;

		for(int i = 0; i < n; i++){
			hako[i] = scan.nextInt();
			sum = sum + hako[i];
		}
		
		//??\?????????

		for (int i=0; i<hako.length; i++) {
			if (max < hako[i]) {
				max = hako[i];
			}
			if (min > hako[i]) {
				min = hako[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[] hako = new int[n]; hako new int[n] n long sum = 0; sum 0 int max = -1000000; max -1000000 1000000 int min = 1000000; min 1000000 for(int i = 0; i < n; i++){
			hako[i] = scan.nextInt();
			sum = sum + hako[i];
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			hako[i] = scan.nextInt();
			sum = sum + hako[i];
		} {
			hako[i] = scan.nextInt();
			sum = sum + hako[i];
		} hako[i] = scan.nextInt() hako[i] hako i scan.nextInt() scan.nextInt scan sum = sum + hako[i] sum sum + hako[i] sum hako[i] hako i for (int i=0; i<hako.length; i++) {
			if (max < hako[i]) {
				max = hako[i];
			}
			if (min > hako[i]) {
				min = hako[i];
			}
		} int i=0; int i=0; i 0 i<hako.length i hako.length hako hako.length i++ i++ i {
			if (max < hako[i]) {
				max = hako[i];
			}
			if (min > hako[i]) {
				min = hako[i];
			}
		} {
			if (max < hako[i]) {
				max = hako[i];
			}
			if (min > hako[i]) {
				min = hako[i];
			}
		} if (max < hako[i]) {
				max = hako[i];
			} max < hako[i] max hako[i] hako i {
				max = hako[i];
			} max = hako[i] max hako[i] hako i if (min > hako[i]) {
				min = hako[i];
			} min > hako[i] min hako[i] hako i {
				min = hako[i];
			} min = hako[i] min hako[i] hako 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
import java.util.Scanner;

class Main{
	@SuppressWarnings("resource")
	public static void main(String[] args) {
		//??\????????£?¨?
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] hako = new int[n];
		long sum = 0;
		int max = -1000000;
		int min = 1000000;

		for(int i = 0; i < n; i++){
			hako[i] = scan.nextInt();
			sum = sum + hako[i];
		}
		
		//??\?????????

		for (int i=0; i<hako.length; i++) {
			if (max < hako[i]) {
				max = hako[i];
			}
			if (min > hako[i]) {
				min = hako[i];
			}
		}
		 
		//??????
		System.out.println(min + " " + max + " " + sum);
	}
}