import java.util.Scanner;

class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int[] nums = new int[n];

		for(int i=0; i<n; i++){
			nums[i] = scan.nextInt();
		}
		scan.close();

		long max = nums[0];
		long min = nums[0];
		long sum = 0;

		for(int s=0; s<nums.length; s++){
			sum += nums[s];
			if(max < nums[s]){
				max = nums[s];
			}
			if(min > nums[s]){
				min = nums[s];
			}
		}

		System.out.println(min + " " + max + " " + sum);
	}

} import java.util.Scanner; Scanner java.util class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int[] nums = new int[n];

		for(int i=0; i<n; i++){
			nums[i] = scan.nextInt();
		}
		scan.close();

		long max = nums[0];
		long min = nums[0];
		long sum = 0;

		for(int s=0; s<nums.length; s++){
			sum += nums[s];
			if(max < nums[s]){
				max = nums[s];
			}
			if(min > nums[s]){
				min = nums[s];
			}
		}

		System.out.println(min + " " + max + " " + sum);
	}

} Main public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int[] nums = new int[n];

		for(int i=0; i<n; i++){
			nums[i] = scan.nextInt();
		}
		scan.close();

		long max = nums[0];
		long min = nums[0];
		long sum = 0;

		for(int s=0; s<nums.length; s++){
			sum += nums[s];
			if(max < nums[s]){
				max = nums[s];
			}
			if(min > nums[s]){
				min = nums[s];
			}
		}

		System.out.println(min + " " + max + " " + sum);
	} main {

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int[] nums = new int[n];

		for(int i=0; i<n; i++){
			nums[i] = scan.nextInt();
		}
		scan.close();

		long max = nums[0];
		long min = nums[0];
		long sum = 0;

		for(int s=0; s<nums.length; s++){
			sum += nums[s];
			if(max < nums[s]){
				max = nums[s];
			}
			if(min > nums[s]){
				min = nums[s];
			}
		}

		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[] nums = new int[n]; nums new int[n] n for(int i=0; i<n; i++){
			nums[i] = scan.nextInt();
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			nums[i] = scan.nextInt();
		} {
			nums[i] = scan.nextInt();
		} nums[i] = scan.nextInt() nums[i] nums i scan.nextInt() scan.nextInt scan scan.close() scan.close scan long max = nums[0]; max nums[0] nums 0 long min = nums[0]; min nums[0] nums 0 long sum = 0; sum 0 for(int s=0; s<nums.length; s++){
			sum += nums[s];
			if(max < nums[s]){
				max = nums[s];
			}
			if(min > nums[s]){
				min = nums[s];
			}
		} int s=0; int s=0; s 0 s<nums.length s nums.length nums nums.length s++ s++ s {
			sum += nums[s];
			if(max < nums[s]){
				max = nums[s];
			}
			if(min > nums[s]){
				min = nums[s];
			}
		} {
			sum += nums[s];
			if(max < nums[s]){
				max = nums[s];
			}
			if(min > nums[s]){
				min = nums[s];
			}
		} sum += nums[s] sum nums[s] nums s if(max < nums[s]){
				max = nums[s];
			} max < nums[s] max nums[s] nums s {
				max = nums[s];
			} max = nums[s] max nums[s] nums s if(min > nums[s]){
				min = nums[s];
			} min > nums[s] min nums[s] nums s {
				min = nums[s];
			} min = nums[s] min nums[s] nums s 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 {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int[] nums = new int[n];

		for(int i=0; i<n; i++){
			nums[i] = scan.nextInt();
		}
		scan.close();

		long max = nums[0];
		long min = nums[0];
		long sum = 0;

		for(int s=0; s<nums.length; s++){
			sum += nums[s];
			if(max < nums[s]){
				max = nums[s];
			}
			if(min > nums[s]){
				min = nums[s];
			}
		}

		System.out.println(min + " " + max + " " + sum);
	}

}