import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int length = scan.nextInt();
		int min = 0, max = 0;
		BigDecimal sum = new BigDecimal(0);
		ArrayList<Integer> elems = new ArrayList<Integer>();
		for (int i = 0; i < length; i++) {
			int elem = scan.nextInt();
			elems.add(elem);
			sum = sum.add(new BigDecimal(elem));
		}
		scan.close();
		Collections.sort(elems);
		min = elems.get(0);
		max = elems.get(elems.size() - 1);
		System.out.println(min + " " + max + " " + sum);
	}
} import java.math.BigDecimal; BigDecimal java.math import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int length = scan.nextInt();
		int min = 0, max = 0;
		BigDecimal sum = new BigDecimal(0);
		ArrayList<Integer> elems = new ArrayList<Integer>();
		for (int i = 0; i < length; i++) {
			int elem = scan.nextInt();
			elems.add(elem);
			sum = sum.add(new BigDecimal(elem));
		}
		scan.close();
		Collections.sort(elems);
		min = elems.get(0);
		max = elems.get(elems.size() - 1);
		System.out.println(min + " " + max + " " + sum);
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int length = scan.nextInt();
		int min = 0, max = 0;
		BigDecimal sum = new BigDecimal(0);
		ArrayList<Integer> elems = new ArrayList<Integer>();
		for (int i = 0; i < length; i++) {
			int elem = scan.nextInt();
			elems.add(elem);
			sum = sum.add(new BigDecimal(elem));
		}
		scan.close();
		Collections.sort(elems);
		min = elems.get(0);
		max = elems.get(elems.size() - 1);
		System.out.println(min + " " + max + " " + sum);
	} main {
		Scanner scan = new Scanner(System.in);
		int length = scan.nextInt();
		int min = 0, max = 0;
		BigDecimal sum = new BigDecimal(0);
		ArrayList<Integer> elems = new ArrayList<Integer>();
		for (int i = 0; i < length; i++) {
			int elem = scan.nextInt();
			elems.add(elem);
			sum = sum.add(new BigDecimal(elem));
		}
		scan.close();
		Collections.sort(elems);
		min = elems.get(0);
		max = elems.get(elems.size() - 1);
		System.out.println(min + " " + max + " " + sum);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int length = scan.nextInt(); length scan.nextInt() scan.nextInt scan int min = 0 min 0 max = 0; max 0 BigDecimal sum = new BigDecimal(0); sum new BigDecimal(0) ArrayList<Integer> elems = new ArrayList<Integer>(); elems new ArrayList<Integer>() for (int i = 0; i < length; i++) {
			int elem = scan.nextInt();
			elems.add(elem);
			sum = sum.add(new BigDecimal(elem));
		} int i = 0; int i = 0; i 0 i < length i length i++ i++ i {
			int elem = scan.nextInt();
			elems.add(elem);
			sum = sum.add(new BigDecimal(elem));
		} {
			int elem = scan.nextInt();
			elems.add(elem);
			sum = sum.add(new BigDecimal(elem));
		} int elem = scan.nextInt(); elem scan.nextInt() scan.nextInt scan elems.add(elem) elems.add elems elem sum = sum.add(new BigDecimal(elem)) sum sum.add(new BigDecimal(elem)) sum.add sum new BigDecimal(elem) scan.close() scan.close scan Collections.sort(elems) Collections.sort Collections elems min = elems.get(0) min elems.get(0) elems.get elems 0 max = elems.get(elems.size() - 1) max elems.get(elems.size() - 1) elems.get elems elems.size() - 1 elems.size() elems.size elems 1 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 scan = new Scanner(System.in);
		int length = scan.nextInt();
		int min = 0, max = 0;
		BigDecimal sum = new BigDecimal(0);
		ArrayList<Integer> elems = new ArrayList<Integer>();
		for (int i = 0; i < length; i++) {
			int elem = scan.nextInt();
			elems.add(elem);
			sum = sum.add(new BigDecimal(elem));
		}
		scan.close();
		Collections.sort(elems);
		min = elems.get(0);
		max = elems.get(elems.size() - 1);
		System.out.println(min + " " + max + " " + sum);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int length = scan.nextInt();
		int min = 0, max = 0;
		BigDecimal sum = new BigDecimal(0);
		ArrayList<Integer> elems = new ArrayList<Integer>();
		for (int i = 0; i < length; i++) {
			int elem = scan.nextInt();
			elems.add(elem);
			sum = sum.add(new BigDecimal(elem));
		}
		scan.close();
		Collections.sort(elems);
		min = elems.get(0);
		max = elems.get(elems.size() - 1);
		System.out.println(min + " " + max + " " + sum);
	}
} Main
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int length = scan.nextInt();
		int min = 0, max = 0;
		BigDecimal sum = new BigDecimal(0);
		ArrayList<Integer> elems = new ArrayList<Integer>();
		for (int i = 0; i < length; i++) {
			int elem = scan.nextInt();
			elems.add(elem);
			sum = sum.add(new BigDecimal(elem));
		}
		scan.close();
		Collections.sort(elems);
		min = elems.get(0);
		max = elems.get(elems.size() - 1);
		System.out.println(min + " " + max + " " + sum);
	}
}