import java.util.*;

class Main{
	public static void main(String args[]){
		int num, max, min;
		long sum = 0;
		Scanner scan = new Scanner(System.in);
		num = scan.nextInt();
		int[] arr = new int[num];

		for(int i=0; i<num; i++) {
			arr[i] = scan.nextInt();
			sum += arr[i];
		}

		Arrays.sort(arr);
		min = arr[0];
		max = arr[num-1];

		System.out.printf("%d %d %d\n", min, max, sum);
	}
} import java.util.*; util.* java class Main{
	public static void main(String args[]){
		int num, max, min;
		long sum = 0;
		Scanner scan = new Scanner(System.in);
		num = scan.nextInt();
		int[] arr = new int[num];

		for(int i=0; i<num; i++) {
			arr[i] = scan.nextInt();
			sum += arr[i];
		}

		Arrays.sort(arr);
		min = arr[0];
		max = arr[num-1];

		System.out.printf("%d %d %d\n", min, max, sum);
	}
} Main public static void main(String args[]){
		int num, max, min;
		long sum = 0;
		Scanner scan = new Scanner(System.in);
		num = scan.nextInt();
		int[] arr = new int[num];

		for(int i=0; i<num; i++) {
			arr[i] = scan.nextInt();
			sum += arr[i];
		}

		Arrays.sort(arr);
		min = arr[0];
		max = arr[num-1];

		System.out.printf("%d %d %d\n", min, max, sum);
	} main {
		int num, max, min;
		long sum = 0;
		Scanner scan = new Scanner(System.in);
		num = scan.nextInt();
		int[] arr = new int[num];

		for(int i=0; i<num; i++) {
			arr[i] = scan.nextInt();
			sum += arr[i];
		}

		Arrays.sort(arr);
		min = arr[0];
		max = arr[num-1];

		System.out.printf("%d %d %d\n", min, max, sum);
	} int num num max max min; min long sum = 0; sum 0 Scanner scan = new Scanner(System.in); scan new Scanner(System.in) num = scan.nextInt() num scan.nextInt() scan.nextInt scan int[] arr = new int[num]; arr new int[num] num for(int i=0; i<num; i++) {
			arr[i] = scan.nextInt();
			sum += arr[i];
		} int i=0; int i=0; i 0 i<num i num i++ i++ i {
			arr[i] = scan.nextInt();
			sum += arr[i];
		} {
			arr[i] = scan.nextInt();
			sum += arr[i];
		} arr[i] = scan.nextInt() arr[i] arr i scan.nextInt() scan.nextInt scan sum += arr[i] sum arr[i] arr i Arrays.sort(arr) Arrays.sort Arrays arr min = arr[0] min arr[0] arr 0 max = arr[num-1] max arr[num-1] arr num-1 num 1 System.out.printf("%d %d %d\n", min, max, sum) System.out.printf System.out System System.out "%d %d %d\n" min max sum String args[] args
import java.util.*;

class Main{
	public static void main(String args[]){
		int num, max, min;
		long sum = 0;
		Scanner scan = new Scanner(System.in);
		num = scan.nextInt();
		int[] arr = new int[num];

		for(int i=0; i<num; i++) {
			arr[i] = scan.nextInt();
			sum += arr[i];
		}

		Arrays.sort(arr);
		min = arr[0];
		max = arr[num-1];

		System.out.printf("%d %d %d\n", min, max, sum);
	}
}