import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		String line2 = sc.nextLine();
		int n = Integer.parseInt(line1);
		String[] x = line2.split(" ");
		int[] a = new int[x.length];

		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(x[i]);
		}

		Arrays.sort(a);

		long sum = 0;
		for (int i = 0; i < n; i++) {
			sum += a[i];
		}

		System.out.println(a[0] + " " + a[n - 1] + " " + sum);

	}

} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		String line2 = sc.nextLine();
		int n = Integer.parseInt(line1);
		String[] x = line2.split(" ");
		int[] a = new int[x.length];

		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(x[i]);
		}

		Arrays.sort(a);

		long sum = 0;
		for (int i = 0; i < n; i++) {
			sum += a[i];
		}

		System.out.println(a[0] + " " + a[n - 1] + " " + sum);

	}

} Main public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		String line2 = sc.nextLine();
		int n = Integer.parseInt(line1);
		String[] x = line2.split(" ");
		int[] a = new int[x.length];

		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(x[i]);
		}

		Arrays.sort(a);

		long sum = 0;
		for (int i = 0; i < n; i++) {
			sum += a[i];
		}

		System.out.println(a[0] + " " + a[n - 1] + " " + sum);

	} main {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		String line2 = sc.nextLine();
		int n = Integer.parseInt(line1);
		String[] x = line2.split(" ");
		int[] a = new int[x.length];

		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(x[i]);
		}

		Arrays.sort(a);

		long sum = 0;
		for (int i = 0; i < n; i++) {
			sum += a[i];
		}

		System.out.println(a[0] + " " + a[n - 1] + " " + sum);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line1 = sc.nextLine(); line1 sc.nextLine() sc.nextLine sc String line2 = sc.nextLine(); line2 sc.nextLine() sc.nextLine sc int n = Integer.parseInt(line1); n Integer.parseInt(line1) Integer.parseInt Integer line1 String[] x = line2.split(" "); x line2.split(" ") line2.split line2 " " int[] a = new int[x.length]; a new int[x.length] x.length x x.length for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(x[i]);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			a[i] = Integer.parseInt(x[i]);
		} {
			a[i] = Integer.parseInt(x[i]);
		} a[i] = Integer.parseInt(x[i]) a[i] a i Integer.parseInt(x[i]) Integer.parseInt Integer x[i] x i Arrays.sort(a) Arrays.sort Arrays a long sum = 0; sum 0 for (int i = 0; i < n; i++) {
			sum += a[i];
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			sum += a[i];
		} {
			sum += a[i];
		} sum += a[i] sum a[i] a i System.out.println(a[0] + " " + a[n - 1] + " " + sum) System.out.println System.out System System.out a[0] + " " + a[n - 1] + " " + sum " " a[n - 1] a[0] + " " + a[n - 1] + " " + sum a[0] a 0 " " a[n - 1] a n - 1 n 1 " " sum String[] args args public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		String line2 = sc.nextLine();
		int n = Integer.parseInt(line1);
		String[] x = line2.split(" ");
		int[] a = new int[x.length];

		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(x[i]);
		}

		Arrays.sort(a);

		long sum = 0;
		for (int i = 0; i < n; i++) {
			sum += a[i];
		}

		System.out.println(a[0] + " " + a[n - 1] + " " + sum);

	}

} public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		String line2 = sc.nextLine();
		int n = Integer.parseInt(line1);
		String[] x = line2.split(" ");
		int[] a = new int[x.length];

		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(x[i]);
		}

		Arrays.sort(a);

		long sum = 0;
		for (int i = 0; i < n; i++) {
			sum += a[i];
		}

		System.out.println(a[0] + " " + a[n - 1] + " " + sum);

	}

} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		String line2 = sc.nextLine();
		int n = Integer.parseInt(line1);
		String[] x = line2.split(" ");
		int[] a = new int[x.length];

		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(x[i]);
		}

		Arrays.sort(a);

		long sum = 0;
		for (int i = 0; i < n; i++) {
			sum += a[i];
		}

		System.out.println(a[0] + " " + a[n - 1] + " " + sum);

	}

}