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().trim();
		final int n = Integer.parseInt(line);

		line = br.readLine().trim();
		String[] arr = line.split(" ");
		br.close();

		long min = 1000000;
		long max = -1000000;
		long sum = 0;
		for (int i = 0; i < n; i++) {
			long v = Long.parseLong(arr[i]);
			min = Math.min(min, v);
			max = Math.max(max, v);
			sum += v;
		}
		System.out.println(min + " " + max + " " + sum);
	}
	
} 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().trim();
		final int n = Integer.parseInt(line);

		line = br.readLine().trim();
		String[] arr = line.split(" ");
		br.close();

		long min = 1000000;
		long max = -1000000;
		long sum = 0;
		for (int i = 0; i < n; i++) {
			long v = Long.parseLong(arr[i]);
			min = Math.min(min, v);
			max = Math.max(max, v);
			sum += v;
		}
		System.out.println(min + " " + max + " " + sum);
	}
	
} Main public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = br.readLine().trim();
		final int n = Integer.parseInt(line);

		line = br.readLine().trim();
		String[] arr = line.split(" ");
		br.close();

		long min = 1000000;
		long max = -1000000;
		long sum = 0;
		for (int i = 0; i < n; i++) {
			long v = Long.parseLong(arr[i]);
			min = Math.min(min, v);
			max = Math.max(max, v);
			sum += v;
		}
		System.out.println(min + " " + max + " " + sum);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = br.readLine().trim();
		final int n = Integer.parseInt(line);

		line = br.readLine().trim();
		String[] arr = line.split(" ");
		br.close();

		long min = 1000000;
		long max = -1000000;
		long sum = 0;
		for (int i = 0; i < n; i++) {
			long v = Long.parseLong(arr[i]);
			min = Math.min(min, v);
			max = Math.max(max, v);
			sum += v;
		}
		System.out.println(min + " " + max + " " + sum);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String line = br.readLine().trim(); line br.readLine().trim() br.readLine().trim br.readLine() br.readLine br final int n = Integer.parseInt(line); n Integer.parseInt(line) Integer.parseInt Integer line line = br.readLine().trim() line br.readLine().trim() br.readLine().trim br.readLine() br.readLine br String[] arr = line.split(" "); arr line.split(" ") line.split line " " br.close() br.close br long min = 1000000; min 1000000 long max = -1000000; max -1000000 1000000 long sum = 0; sum 0 for (int i = 0; i < n; i++) {
			long v = Long.parseLong(arr[i]);
			min = Math.min(min, v);
			max = Math.max(max, v);
			sum += v;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			long v = Long.parseLong(arr[i]);
			min = Math.min(min, v);
			max = Math.max(max, v);
			sum += v;
		} {
			long v = Long.parseLong(arr[i]);
			min = Math.min(min, v);
			max = Math.max(max, v);
			sum += v;
		} long v = Long.parseLong(arr[i]); v Long.parseLong(arr[i]) Long.parseLong Long arr[i] arr i min = Math.min(min, v) min Math.min(min, v) Math.min Math min v max = Math.max(max, v) max Math.max(max, v) Math.max Math max v sum += v sum v 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) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = br.readLine().trim();
		final int n = Integer.parseInt(line);

		line = br.readLine().trim();
		String[] arr = line.split(" ");
		br.close();

		long min = 1000000;
		long max = -1000000;
		long sum = 0;
		for (int i = 0; i < n; i++) {
			long v = Long.parseLong(arr[i]);
			min = Math.min(min, v);
			max = Math.max(max, v);
			sum += v;
		}
		System.out.println(min + " " + max + " " + sum);
	}
	
} public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = br.readLine().trim();
		final int n = Integer.parseInt(line);

		line = br.readLine().trim();
		String[] arr = line.split(" ");
		br.close();

		long min = 1000000;
		long max = -1000000;
		long sum = 0;
		for (int i = 0; i < n; i++) {
			long v = Long.parseLong(arr[i]);
			min = Math.min(min, v);
			max = Math.max(max, v);
			sum += v;
		}
		System.out.println(min + " " + max + " " + sum);
	}
	
} 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().trim();
		final int n = Integer.parseInt(line);

		line = br.readLine().trim();
		String[] arr = line.split(" ");
		br.close();

		long min = 1000000;
		long max = -1000000;
		long sum = 0;
		for (int i = 0; i < n; i++) {
			long v = Long.parseLong(arr[i]);
			min = Math.min(min, v);
			max = Math.max(max, v);
			sum += v;
		}
		System.out.println(min + " " + max + " " + sum);
	}
	
}