import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		long sum = 0;
		int[] nums = new int[a];
		
		for(int i = 0; i < a; i++){
			nums[i] = sc.nextInt();
			sum += nums[i];
		}
		
		int max = nums[0];
		int min = nums[0];
		for (int n : nums) {
			max = Math.max(max,n);
			min = Math.min(min, n);
		}
		
		System.out.println(min + " " + max + " " + sum);
	}

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		long sum = 0;
		int[] nums = new int[a];
		
		for(int i = 0; i < a; i++){
			nums[i] = sc.nextInt();
			sum += nums[i];
		}
		
		int max = nums[0];
		int min = nums[0];
		for (int n : nums) {
			max = Math.max(max,n);
			min = Math.min(min, n);
		}
		
		System.out.println(min + " " + max + " " + sum);
	}

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		long sum = 0;
		int[] nums = new int[a];
		
		for(int i = 0; i < a; i++){
			nums[i] = sc.nextInt();
			sum += nums[i];
		}
		
		int max = nums[0];
		int min = nums[0];
		for (int n : nums) {
			max = Math.max(max,n);
			min = Math.min(min, n);
		}
		
		System.out.println(min + " " + max + " " + sum);
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		long sum = 0;
		int[] nums = new int[a];
		
		for(int i = 0; i < a; i++){
			nums[i] = sc.nextInt();
			sum += nums[i];
		}
		
		int max = nums[0];
		int min = nums[0];
		for (int n : nums) {
			max = Math.max(max,n);
			min = Math.min(min, n);
		}
		
		System.out.println(min + " " + max + " " + sum);
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		long sum = 0;
		int[] nums = new int[a];
		
		for(int i = 0; i < a; i++){
			nums[i] = sc.nextInt();
			sum += nums[i];
		}
		
		int max = nums[0];
		int min = nums[0];
		for (int n : nums) {
			max = Math.max(max,n);
			min = Math.min(min, n);
		}
		
		System.out.println(min + " " + max + " " + sum);
	}

}