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

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int nn = scan.nextInt();

		int[] aiai;
		aiai = new int[nn];

		long total = 0;
		for (int i = 0; i < nn; i++) {
			aiai[i] = scan.nextInt();
			total = total + aiai[i];
		}

		Arrays.sort(aiai);
		System.out.println(aiai[0] + " " + aiai[nn - 1] + " " + total);

	}

} 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 nn = scan.nextInt();

		int[] aiai;
		aiai = new int[nn];

		long total = 0;
		for (int i = 0; i < nn; i++) {
			aiai[i] = scan.nextInt();
			total = total + aiai[i];
		}

		Arrays.sort(aiai);
		System.out.println(aiai[0] + " " + aiai[nn - 1] + " " + total);

	}

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

		Scanner scan = new Scanner(System.in);

		int nn = scan.nextInt();

		int[] aiai;
		aiai = new int[nn];

		long total = 0;
		for (int i = 0; i < nn; i++) {
			aiai[i] = scan.nextInt();
			total = total + aiai[i];
		}

		Arrays.sort(aiai);
		System.out.println(aiai[0] + " " + aiai[nn - 1] + " " + total);

	} main {

		Scanner scan = new Scanner(System.in);

		int nn = scan.nextInt();

		int[] aiai;
		aiai = new int[nn];

		long total = 0;
		for (int i = 0; i < nn; i++) {
			aiai[i] = scan.nextInt();
			total = total + aiai[i];
		}

		Arrays.sort(aiai);
		System.out.println(aiai[0] + " " + aiai[nn - 1] + " " + total);

	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int nn = scan.nextInt(); nn scan.nextInt() scan.nextInt scan int[] aiai; aiai aiai = new int[nn] aiai new int[nn] nn long total = 0; total 0 for (int i = 0; i < nn; i++) {
			aiai[i] = scan.nextInt();
			total = total + aiai[i];
		} int i = 0; int i = 0; i 0 i < nn i nn i++ i++ i {
			aiai[i] = scan.nextInt();
			total = total + aiai[i];
		} {
			aiai[i] = scan.nextInt();
			total = total + aiai[i];
		} aiai[i] = scan.nextInt() aiai[i] aiai i scan.nextInt() scan.nextInt scan total = total + aiai[i] total total + aiai[i] total aiai[i] aiai i Arrays.sort(aiai) Arrays.sort Arrays aiai System.out.println(aiai[0] + " " + aiai[nn - 1] + " " + total) System.out.println System.out System System.out aiai[0] + " " + aiai[nn - 1] + " " + total " " aiai[nn - 1] aiai[0] + " " + aiai[nn - 1] + " " + total aiai[0] aiai 0 " " aiai[nn - 1] aiai nn - 1 nn 1 " " total String[] args args public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int nn = scan.nextInt();

		int[] aiai;
		aiai = new int[nn];

		long total = 0;
		for (int i = 0; i < nn; i++) {
			aiai[i] = scan.nextInt();
			total = total + aiai[i];
		}

		Arrays.sort(aiai);
		System.out.println(aiai[0] + " " + aiai[nn - 1] + " " + total);

	}

} public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int nn = scan.nextInt();

		int[] aiai;
		aiai = new int[nn];

		long total = 0;
		for (int i = 0; i < nn; i++) {
			aiai[i] = scan.nextInt();
			total = total + aiai[i];
		}

		Arrays.sort(aiai);
		System.out.println(aiai[0] + " " + aiai[nn - 1] + " " + total);

	}

} 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 nn = scan.nextInt();

		int[] aiai;
		aiai = new int[nn];

		long total = 0;
		for (int i = 0; i < nn; i++) {
			aiai[i] = scan.nextInt();
			total = total + aiai[i];
		}

		Arrays.sort(aiai);
		System.out.println(aiai[0] + " " + aiai[nn - 1] + " " + total);

	}

}