import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String n = br.readLine();
		List<Integer>list = new ArrayList<Integer>();
		String[]fList = br.readLine().split(" ");
		for(int i = 0; i < Integer.parseInt(n); i++){
			list.add(Integer.parseInt(fList[i]));
		}
		System.out.println(searchMin(list) + " " + searchMax(list) + " " + sum(list));
	}

	static int searchMin(List<Integer> list) {
		int min = 1000000;
		for (int i = 0; i < list.size(); i++) {
			if (min > list.get(i)) {
				min = list.get(i);
			}
		}
		return min;
	}

	static int searchMax(List<Integer> list) {
		int max = -1000000;
		for (int i = 0; i < list.size(); i++) {
			if (max < list.get(i)) {
				max = list.get(i);
			}
		}
		return max;
	}

	static long sum(List<Integer> list) {
		long sum = 0;
		for (int i = 0; i < list.size(); i++) {
			sum = sum + list.get(i);
		}
		return sum;
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String n = br.readLine();
		List<Integer>list = new ArrayList<Integer>();
		String[]fList = br.readLine().split(" ");
		for(int i = 0; i < Integer.parseInt(n); i++){
			list.add(Integer.parseInt(fList[i]));
		}
		System.out.println(searchMin(list) + " " + searchMax(list) + " " + sum(list));
	}

	static int searchMin(List<Integer> list) {
		int min = 1000000;
		for (int i = 0; i < list.size(); i++) {
			if (min > list.get(i)) {
				min = list.get(i);
			}
		}
		return min;
	}

	static int searchMax(List<Integer> list) {
		int max = -1000000;
		for (int i = 0; i < list.size(); i++) {
			if (max < list.get(i)) {
				max = list.get(i);
			}
		}
		return max;
	}

	static long sum(List<Integer> list) {
		long sum = 0;
		for (int i = 0; i < list.size(); i++) {
			sum = sum + list.get(i);
		}
		return sum;
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String n = br.readLine();
		List<Integer>list = new ArrayList<Integer>();
		String[]fList = br.readLine().split(" ");
		for(int i = 0; i < Integer.parseInt(n); i++){
			list.add(Integer.parseInt(fList[i]));
		}
		System.out.println(searchMin(list) + " " + searchMax(list) + " " + sum(list));
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String n = br.readLine();
		List<Integer>list = new ArrayList<Integer>();
		String[]fList = br.readLine().split(" ");
		for(int i = 0; i < Integer.parseInt(n); i++){
			list.add(Integer.parseInt(fList[i]));
		}
		System.out.println(searchMin(list) + " " + searchMax(list) + " " + sum(list));
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String n = br.readLine(); n br.readLine() br.readLine br List<Integer>list = new ArrayList<Integer>(); list new ArrayList<Integer>() String[]fList = br.readLine().split(" "); fList br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " for(int i = 0; i < Integer.parseInt(n); i++){
			list.add(Integer.parseInt(fList[i]));
		} int i = 0; int i = 0; i 0 i < Integer.parseInt(n) i Integer.parseInt(n) Integer.parseInt Integer n i++ i++ i {
			list.add(Integer.parseInt(fList[i]));
		} {
			list.add(Integer.parseInt(fList[i]));
		} list.add(Integer.parseInt(fList[i])) list.add list Integer.parseInt(fList[i]) Integer.parseInt Integer fList[i] fList i System.out.println(searchMin(list) + " " + searchMax(list) + " " + sum(list)) System.out.println System.out System System.out searchMin(list) + " " + searchMax(list) + " " + sum(list) " " searchMax(list) searchMin(list) + " " + searchMax(list) + " " + sum(list) searchMin(list) searchMin list " " searchMax(list) searchMax list " " sum(list) sum list String[] args args static int searchMin(List<Integer> list) {
		int min = 1000000;
		for (int i = 0; i < list.size(); i++) {
			if (min > list.get(i)) {
				min = list.get(i);
			}
		}
		return min;
	} searchMin {
		int min = 1000000;
		for (int i = 0; i < list.size(); i++) {
			if (min > list.get(i)) {
				min = list.get(i);
			}
		}
		return min;
	} int min = 1000000; min 1000000 for (int i = 0; i < list.size(); i++) {
			if (min > list.get(i)) {
				min = list.get(i);
			}
		} int i = 0; int i = 0; i 0 i < list.size() i list.size() list.size list i++ i++ i {
			if (min > list.get(i)) {
				min = list.get(i);
			}
		} {
			if (min > list.get(i)) {
				min = list.get(i);
			}
		} if (min > list.get(i)) {
				min = list.get(i);
			} min > list.get(i) min list.get(i) list.get list i {
				min = list.get(i);
			} min = list.get(i) min list.get(i) list.get list i return min; min List<Integer> list list static int searchMax(List<Integer> list) {
		int max = -1000000;
		for (int i = 0; i < list.size(); i++) {
			if (max < list.get(i)) {
				max = list.get(i);
			}
		}
		return max;
	} searchMax {
		int max = -1000000;
		for (int i = 0; i < list.size(); i++) {
			if (max < list.get(i)) {
				max = list.get(i);
			}
		}
		return max;
	} int max = -1000000; max -1000000 1000000 for (int i = 0; i < list.size(); i++) {
			if (max < list.get(i)) {
				max = list.get(i);
			}
		} int i = 0; int i = 0; i 0 i < list.size() i list.size() list.size list i++ i++ i {
			if (max < list.get(i)) {
				max = list.get(i);
			}
		} {
			if (max < list.get(i)) {
				max = list.get(i);
			}
		} if (max < list.get(i)) {
				max = list.get(i);
			} max < list.get(i) max list.get(i) list.get list i {
				max = list.get(i);
			} max = list.get(i) max list.get(i) list.get list i return max; max List<Integer> list list static long sum(List<Integer> list) {
		long sum = 0;
		for (int i = 0; i < list.size(); i++) {
			sum = sum + list.get(i);
		}
		return sum;
	} sum {
		long sum = 0;
		for (int i = 0; i < list.size(); i++) {
			sum = sum + list.get(i);
		}
		return sum;
	} long sum = 0; sum 0 for (int i = 0; i < list.size(); i++) {
			sum = sum + list.get(i);
		} int i = 0; int i = 0; i 0 i < list.size() i list.size() list.size list i++ i++ i {
			sum = sum + list.get(i);
		} {
			sum = sum + list.get(i);
		} sum = sum + list.get(i) sum sum + list.get(i) sum list.get(i) list.get list i return sum; sum List<Integer> list list
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String n = br.readLine();
		List<Integer>list = new ArrayList<Integer>();
		String[]fList = br.readLine().split(" ");
		for(int i = 0; i < Integer.parseInt(n); i++){
			list.add(Integer.parseInt(fList[i]));
		}
		System.out.println(searchMin(list) + " " + searchMax(list) + " " + sum(list));
	}

	static int searchMin(List<Integer> list) {
		int min = 1000000;
		for (int i = 0; i < list.size(); i++) {
			if (min > list.get(i)) {
				min = list.get(i);
			}
		}
		return min;
	}

	static int searchMax(List<Integer> list) {
		int max = -1000000;
		for (int i = 0; i < list.size(); i++) {
			if (max < list.get(i)) {
				max = list.get(i);
			}
		}
		return max;
	}

	static long sum(List<Integer> list) {
		long sum = 0;
		for (int i = 0; i < list.size(); i++) {
			sum = sum + list.get(i);
		}
		return sum;
	}
}