public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);

		int n = Integer.parseInt( sc.nextLine() );

		String[] stra = sc.nextLine().split(" ");
		long[] a = new long[n];
		for ( int i = 0; i < n; i++) {
			a[i] = Long.parseLong(stra[i]);
		}

		java.util.Arrays.sort(a);
		long min = a[0];
		long max = a[n-1];

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

		System.out.printf("%d %d %d\n", min, max, sum);
	}

} public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);

		int n = Integer.parseInt( sc.nextLine() );

		String[] stra = sc.nextLine().split(" ");
		long[] a = new long[n];
		for ( int i = 0; i < n; i++) {
			a[i] = Long.parseLong(stra[i]);
		}

		java.util.Arrays.sort(a);
		long min = a[0];
		long max = a[n-1];

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

		System.out.printf("%d %d %d\n", min, max, sum);
	}

} Main public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);

		int n = Integer.parseInt( sc.nextLine() );

		String[] stra = sc.nextLine().split(" ");
		long[] a = new long[n];
		for ( int i = 0; i < n; i++) {
			a[i] = Long.parseLong(stra[i]);
		}

		java.util.Arrays.sort(a);
		long min = a[0];
		long max = a[n-1];

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

		System.out.printf("%d %d %d\n", min, max, sum);
	} main {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);

		int n = Integer.parseInt( sc.nextLine() );

		String[] stra = sc.nextLine().split(" ");
		long[] a = new long[n];
		for ( int i = 0; i < n; i++) {
			a[i] = Long.parseLong(stra[i]);
		}

		java.util.Arrays.sort(a);
		long min = a[0];
		long max = a[n-1];

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

		System.out.printf("%d %d %d\n", min, max, sum);
	} java.util.Scanner sc = new java.util.Scanner(System.in); sc new java.util.Scanner(System.in) int n = Integer.parseInt( sc.nextLine() ); n Integer.parseInt( sc.nextLine() ) Integer.parseInt Integer sc.nextLine() sc.nextLine sc String[] stra = sc.nextLine().split(" "); stra sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " long[] a = new long[n]; a new long[n] n for ( int i = 0; i < n; i++) {
			a[i] = Long.parseLong(stra[i]);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			a[i] = Long.parseLong(stra[i]);
		} {
			a[i] = Long.parseLong(stra[i]);
		} a[i] = Long.parseLong(stra[i]) a[i] a i Long.parseLong(stra[i]) Long.parseLong Long stra[i] stra i java.util.Arrays.sort(a) java.util.Arrays.sort java.util.Arrays java.util java java.util java.util.Arrays a long min = a[0]; min a[0] a 0 long max = a[n-1]; max a[n-1] a n-1 n 1 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.printf("%d %d %d\n", min, max, sum) System.out.printf System.out System System.out "%d %d %d\n" min max sum String[] args args public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);

		int n = Integer.parseInt( sc.nextLine() );

		String[] stra = sc.nextLine().split(" ");
		long[] a = new long[n];
		for ( int i = 0; i < n; i++) {
			a[i] = Long.parseLong(stra[i]);
		}

		java.util.Arrays.sort(a);
		long min = a[0];
		long max = a[n-1];

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

		System.out.printf("%d %d %d\n", min, max, sum);
	}

} public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);

		int n = Integer.parseInt( sc.nextLine() );

		String[] stra = sc.nextLine().split(" ");
		long[] a = new long[n];
		for ( int i = 0; i < n; i++) {
			a[i] = Long.parseLong(stra[i]);
		}

		java.util.Arrays.sort(a);
		long min = a[0];
		long max = a[n-1];

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

		System.out.printf("%d %d %d\n", min, max, sum);
	}

} Main
public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);

		int n = Integer.parseInt( sc.nextLine() );

		String[] stra = sc.nextLine().split(" ");
		long[] a = new long[n];
		for ( int i = 0; i < n; i++) {
			a[i] = Long.parseLong(stra[i]);
		}

		java.util.Arrays.sort(a);
		long min = a[0];
		long max = a[n-1];

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

		System.out.printf("%d %d %d\n", min, max, sum);
	}

}