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

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String line = br.readLine();
		int n  = Integer.parseInt(line);

		int min = Integer.MAX_VALUE;
		int max = Integer.MIN_VALUE;
		long total = 0L;

		String[] numline  = br.readLine().split(" ");

		for (int i = 0; i < numline.length; i++) {
			int input = Integer.parseInt(numline[i]);

			if (min > input) min = input;
			if (max < input) max = input;
			total += input;
		}

		System.out.println(min + " " + max + " " + total);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String line = br.readLine();
		int n  = Integer.parseInt(line);

		int min = Integer.MAX_VALUE;
		int max = Integer.MIN_VALUE;
		long total = 0L;

		String[] numline  = br.readLine().split(" ");

		for (int i = 0; i < numline.length; i++) {
			int input = Integer.parseInt(numline[i]);

			if (min > input) min = input;
			if (max < input) max = input;
			total += input;
		}

		System.out.println(min + " " + max + " " + total);
	}
} Main public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String line = br.readLine();
		int n  = Integer.parseInt(line);

		int min = Integer.MAX_VALUE;
		int max = Integer.MIN_VALUE;
		long total = 0L;

		String[] numline  = br.readLine().split(" ");

		for (int i = 0; i < numline.length; i++) {
			int input = Integer.parseInt(numline[i]);

			if (min > input) min = input;
			if (max < input) max = input;
			total += input;
		}

		System.out.println(min + " " + max + " " + total);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String line = br.readLine();
		int n  = Integer.parseInt(line);

		int min = Integer.MAX_VALUE;
		int max = Integer.MIN_VALUE;
		long total = 0L;

		String[] numline  = br.readLine().split(" ");

		for (int i = 0; i < numline.length; i++) {
			int input = Integer.parseInt(numline[i]);

			if (min > input) min = input;
			if (max < input) max = input;
			total += input;
		}

		System.out.println(min + " " + max + " " + total);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String line = br.readLine(); line br.readLine() br.readLine br int n  = Integer.parseInt(line); n Integer.parseInt(line) Integer.parseInt Integer line int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE int max = Integer.MIN_VALUE; max Integer.MIN_VALUE Integer Integer.MIN_VALUE long total = 0L; total 0L String[] numline  = br.readLine().split(" "); numline br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " for (int i = 0; i < numline.length; i++) {
			int input = Integer.parseInt(numline[i]);

			if (min > input) min = input;
			if (max < input) max = input;
			total += input;
		} int i = 0; int i = 0; i 0 i < numline.length i numline.length numline numline.length i++ i++ i {
			int input = Integer.parseInt(numline[i]);

			if (min > input) min = input;
			if (max < input) max = input;
			total += input;
		} {
			int input = Integer.parseInt(numline[i]);

			if (min > input) min = input;
			if (max < input) max = input;
			total += input;
		} int input = Integer.parseInt(numline[i]); input Integer.parseInt(numline[i]) Integer.parseInt Integer numline[i] numline i if (min > input) min = input; min > input min input min = input min input if (max < input) max = input; max < input max input max = input max input total += input total input System.out.println(min + " " + max + " " + total) System.out.println System.out System System.out min + " " + max + " " + total " " max min + " " + max + " " + total min " " max " " total String[] args args public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String line = br.readLine();
		int n  = Integer.parseInt(line);

		int min = Integer.MAX_VALUE;
		int max = Integer.MIN_VALUE;
		long total = 0L;

		String[] numline  = br.readLine().split(" ");

		for (int i = 0; i < numline.length; i++) {
			int input = Integer.parseInt(numline[i]);

			if (min > input) min = input;
			if (max < input) max = input;
			total += input;
		}

		System.out.println(min + " " + max + " " + total);
	}
} public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String line = br.readLine();
		int n  = Integer.parseInt(line);

		int min = Integer.MAX_VALUE;
		int max = Integer.MIN_VALUE;
		long total = 0L;

		String[] numline  = br.readLine().split(" ");

		for (int i = 0; i < numline.length; i++) {
			int input = Integer.parseInt(numline[i]);

			if (min > input) min = input;
			if (max < input) max = input;
			total += input;
		}

		System.out.println(min + " " + max + " " + total);
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String line = br.readLine();
		int n  = Integer.parseInt(line);

		int min = Integer.MAX_VALUE;
		int max = Integer.MIN_VALUE;
		long total = 0L;

		String[] numline  = br.readLine().split(" ");

		for (int i = 0; i < numline.length; i++) {
			int input = Integer.parseInt(numline[i]);

			if (min > input) min = input;
			if (max < input) max = input;
			total += input;
		}

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