//Computation - Min, Max and Sum
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {

	public static void main(String[] args) throws IOException {

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

		 int n =Integer.parseInt(in.readLine());
		 String[] a = in.readLine().split(" ");

//		int n = Integer.parseInt("10000");

		int min = 1000000;
		int max = -1000000;
		long sum = 0;

		int ai;

		for (int i = 0; i < n; i++) {

			ai = Integer.parseInt(a[i]);

			if (ai < min) {
				min = ai;
			}

			if (ai > max) {
				max = ai;
			}

			sum += ai;

		}

		System.out.println(min + " " + max + " " + sum);

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

	public static void main(String[] args) throws IOException {

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

		 int n =Integer.parseInt(in.readLine());
		 String[] a = in.readLine().split(" ");

//		int n = Integer.parseInt("10000");

		int min = 1000000;
		int max = -1000000;
		long sum = 0;

		int ai;

		for (int i = 0; i < n; i++) {

			ai = Integer.parseInt(a[i]);

			if (ai < min) {
				min = ai;
			}

			if (ai > max) {
				max = ai;
			}

			sum += ai;

		}

		System.out.println(min + " " + max + " " + sum);

	}
} Main public static void main(String[] args) throws IOException {

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

		 int n =Integer.parseInt(in.readLine());
		 String[] a = in.readLine().split(" ");

//		int n = Integer.parseInt("10000");

		int min = 1000000;
		int max = -1000000;
		long sum = 0;

		int ai;

		for (int i = 0; i < n; i++) {

			ai = Integer.parseInt(a[i]);

			if (ai < min) {
				min = ai;
			}

			if (ai > max) {
				max = ai;
			}

			sum += ai;

		}

		System.out.println(min + " " + max + " " + sum);

	} main {

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

		 int n =Integer.parseInt(in.readLine());
		 String[] a = in.readLine().split(" ");

//		int n = Integer.parseInt("10000");

		int min = 1000000;
		int max = -1000000;
		long sum = 0;

		int ai;

		for (int i = 0; i < n; i++) {

			ai = Integer.parseInt(a[i]);

			if (ai < min) {
				min = ai;
			}

			if (ai > max) {
				max = ai;
			}

			sum += ai;

		}

		System.out.println(min + " " + max + " " + sum);

	} BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) int n =Integer.parseInt(in.readLine()); n Integer.parseInt(in.readLine()) Integer.parseInt Integer in.readLine() in.readLine in String[] a = in.readLine().split(" "); a in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " int min = 1000000; min 1000000 int max = -1000000; max -1000000 1000000 long sum = 0; sum 0 int ai; ai for (int i = 0; i < n; i++) {

			ai = Integer.parseInt(a[i]);

			if (ai < min) {
				min = ai;
			}

			if (ai > max) {
				max = ai;
			}

			sum += ai;

		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {

			ai = Integer.parseInt(a[i]);

			if (ai < min) {
				min = ai;
			}

			if (ai > max) {
				max = ai;
			}

			sum += ai;

		} {

			ai = Integer.parseInt(a[i]);

			if (ai < min) {
				min = ai;
			}

			if (ai > max) {
				max = ai;
			}

			sum += ai;

		} ai = Integer.parseInt(a[i]) ai Integer.parseInt(a[i]) Integer.parseInt Integer a[i] a i if (ai < min) {
				min = ai;
			} ai < min ai min {
				min = ai;
			} min = ai min ai if (ai > max) {
				max = ai;
			} ai > max ai max {
				max = ai;
			} max = ai max ai sum += ai sum ai 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
//Computation - Min, Max and Sum
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {

	public static void main(String[] args) throws IOException {

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

		 int n =Integer.parseInt(in.readLine());
		 String[] a = in.readLine().split(" ");

//		int n = Integer.parseInt("10000");

		int min = 1000000;
		int max = -1000000;
		long sum = 0;

		int ai;

		for (int i = 0; i < n; i++) {

			ai = Integer.parseInt(a[i]);

			if (ai < min) {
				min = ai;
			}

			if (ai > max) {
				max = ai;
			}

			sum += ai;

		}

		System.out.println(min + " " + max + " " + sum);

	}
}