import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String[] inputNum = br.readLine().split(" ");
		int minNum = Integer.parseInt(inputNum[0]);
		int maxNum = Integer.parseInt(inputNum[0]);
		long total = 0;

		for (int i = 0; i < n; i++) {
			int num =  Integer.parseInt(inputNum[i]);
			if (num < minNum) {
				 minNum = num;
			}else if (maxNum < num) {
				maxNum = num;
			}
			total += num;
		}

		System.out.println(minNum + " " + maxNum + " " + total);
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String[] inputNum = br.readLine().split(" ");
		int minNum = Integer.parseInt(inputNum[0]);
		int maxNum = Integer.parseInt(inputNum[0]);
		long total = 0;

		for (int i = 0; i < n; i++) {
			int num =  Integer.parseInt(inputNum[i]);
			if (num < minNum) {
				 minNum = num;
			}else if (maxNum < num) {
				maxNum = num;
			}
			total += num;
		}

		System.out.println(minNum + " " + maxNum + " " + total);
	}

} Main public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String[] inputNum = br.readLine().split(" ");
		int minNum = Integer.parseInt(inputNum[0]);
		int maxNum = Integer.parseInt(inputNum[0]);
		long total = 0;

		for (int i = 0; i < n; i++) {
			int num =  Integer.parseInt(inputNum[i]);
			if (num < minNum) {
				 minNum = num;
			}else if (maxNum < num) {
				maxNum = num;
			}
			total += num;
		}

		System.out.println(minNum + " " + maxNum + " " + total);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String[] inputNum = br.readLine().split(" ");
		int minNum = Integer.parseInt(inputNum[0]);
		int maxNum = Integer.parseInt(inputNum[0]);
		long total = 0;

		for (int i = 0; i < n; i++) {
			int num =  Integer.parseInt(inputNum[i]);
			if (num < minNum) {
				 minNum = num;
			}else if (maxNum < num) {
				maxNum = num;
			}
			total += num;
		}

		System.out.println(minNum + " " + maxNum + " " + total);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String[] inputNum = br.readLine().split(" "); inputNum br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int minNum = Integer.parseInt(inputNum[0]); minNum Integer.parseInt(inputNum[0]) Integer.parseInt Integer inputNum[0] inputNum 0 int maxNum = Integer.parseInt(inputNum[0]); maxNum Integer.parseInt(inputNum[0]) Integer.parseInt Integer inputNum[0] inputNum 0 long total = 0; total 0 for (int i = 0; i < n; i++) {
			int num =  Integer.parseInt(inputNum[i]);
			if (num < minNum) {
				 minNum = num;
			}else if (maxNum < num) {
				maxNum = num;
			}
			total += num;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int num =  Integer.parseInt(inputNum[i]);
			if (num < minNum) {
				 minNum = num;
			}else if (maxNum < num) {
				maxNum = num;
			}
			total += num;
		} {
			int num =  Integer.parseInt(inputNum[i]);
			if (num < minNum) {
				 minNum = num;
			}else if (maxNum < num) {
				maxNum = num;
			}
			total += num;
		} int num =  Integer.parseInt(inputNum[i]); num Integer.parseInt(inputNum[i]) Integer.parseInt Integer inputNum[i] inputNum i if (num < minNum) {
				 minNum = num;
			}else if (maxNum < num) {
				maxNum = num;
			} num < minNum num minNum {
				 minNum = num;
			} minNum = num minNum num if (maxNum < num) {
				maxNum = num;
			} maxNum < num maxNum num {
				maxNum = num;
			} maxNum = num maxNum num total += num total num System.out.println(minNum + " " + maxNum + " " + total) System.out.println System.out System System.out minNum + " " + maxNum + " " + total " " maxNum minNum + " " + maxNum + " " + total minNum " " maxNum " " total String[] args args public class Main {

	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String[] inputNum = br.readLine().split(" ");
		int minNum = Integer.parseInt(inputNum[0]);
		int maxNum = Integer.parseInt(inputNum[0]);
		long total = 0;

		for (int i = 0; i < n; i++) {
			int num =  Integer.parseInt(inputNum[i]);
			if (num < minNum) {
				 minNum = num;
			}else if (maxNum < num) {
				maxNum = num;
			}
			total += num;
		}

		System.out.println(minNum + " " + maxNum + " " + total);
	}

} public class Main {

	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String[] inputNum = br.readLine().split(" ");
		int minNum = Integer.parseInt(inputNum[0]);
		int maxNum = Integer.parseInt(inputNum[0]);
		long total = 0;

		for (int i = 0; i < n; i++) {
			int num =  Integer.parseInt(inputNum[i]);
			if (num < minNum) {
				 minNum = num;
			}else if (maxNum < num) {
				maxNum = num;
			}
			total += num;
		}

		System.out.println(minNum + " " + maxNum + " " + total);
	}

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String[] inputNum = br.readLine().split(" ");
		int minNum = Integer.parseInt(inputNum[0]);
		int maxNum = Integer.parseInt(inputNum[0]);
		long total = 0;

		for (int i = 0; i < n; i++) {
			int num =  Integer.parseInt(inputNum[i]);
			if (num < minNum) {
				 minNum = num;
			}else if (maxNum < num) {
				maxNum = num;
			}
			total += num;
		}

		System.out.println(minNum + " " + maxNum + " " + total);
	}

}