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

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();

		int[] a = new int[n];

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

		Arrays.sort(a);

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

		scan.close();
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();

		int[] a = new int[n];

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

		Arrays.sort(a);

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

		scan.close();
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();

		int[] a = new int[n];

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

		Arrays.sort(a);

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

		scan.close();
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();

		int[] a = new int[n];

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

		Arrays.sort(a);

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

		scan.close();
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int[] a = new int[n]; a new int[n] n long sum = 0; sum 0 for(int i = 0; i < n; i++) {
			a[i] = scan.nextInt();
			sum += a[i];
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			a[i] = scan.nextInt();
			sum += a[i];
		} {
			a[i] = scan.nextInt();
			sum += a[i];
		} a[i] = scan.nextInt() a[i] a i scan.nextInt() scan.nextInt scan sum += a[i] sum a[i] a i Arrays.sort(a) Arrays.sort Arrays a System.out.println(a[0] + " " + a[a.length - 1] + " " + sum) System.out.println System.out System System.out a[0] + " " + a[a.length - 1] + " " + sum " " a[a.length - 1] a[0] + " " + a[a.length - 1] + " " + sum a[0] a 0 " " a[a.length - 1] a a.length - 1 a.length a a.length 1 " " sum scan.close() scan.close scan String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();

		int[] a = new int[n];

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

		Arrays.sort(a);

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

		scan.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();

		int[] a = new int[n];

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

		Arrays.sort(a);

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

		scan.close();
	}
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();

		int[] a = new int[n];

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

		Arrays.sort(a);

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

		scan.close();
	}
}
