import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a[] = new int[n];
		long sum = 0;
		for (int i = 0; i < n; i++) {
			a[i]=sc.nextInt();
			sum += a[i];
		}
		int max = a[0];
		int min = a[0];
		for (int i = 1; i < n; i++) {
			if (max > a[i])
				max = a[i];
			if (min < a[i])
				min = a[i];
		}
		System.out.println(max+" "+min+" "+sum);

		sc.close();
	}
}
 import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a[] = new int[n];
		long sum = 0;
		for (int i = 0; i < n; i++) {
			a[i]=sc.nextInt();
			sum += a[i];
		}
		int max = a[0];
		int min = a[0];
		for (int i = 1; i < n; i++) {
			if (max > a[i])
				max = a[i];
			if (min < a[i])
				min = a[i];
		}
		System.out.println(max+" "+min+" "+sum);

		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a[] = new int[n];
		long sum = 0;
		for (int i = 0; i < n; i++) {
			a[i]=sc.nextInt();
			sum += a[i];
		}
		int max = a[0];
		int min = a[0];
		for (int i = 1; i < n; i++) {
			if (max > a[i])
				max = a[i];
			if (min < a[i])
				min = a[i];
		}
		System.out.println(max+" "+min+" "+sum);

		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a[] = new int[n];
		long sum = 0;
		for (int i = 0; i < n; i++) {
			a[i]=sc.nextInt();
			sum += a[i];
		}
		int max = a[0];
		int min = a[0];
		for (int i = 1; i < n; i++) {
			if (max > a[i])
				max = a[i];
			if (min < a[i])
				min = a[i];
		}
		System.out.println(max+" "+min+" "+sum);

		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int a[] = new int[n]; a new int[n] n long sum = 0; sum 0 for (int i = 0; i < n; i++) {
			a[i]=sc.nextInt();
			sum += a[i];
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			a[i]=sc.nextInt();
			sum += a[i];
		} {
			a[i]=sc.nextInt();
			sum += a[i];
		} a[i]=sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc sum += a[i] sum a[i] a i int max = a[0]; max a[0] a 0 int min = a[0]; min a[0] a 0 for (int i = 1; i < n; i++) {
			if (max > a[i])
				max = a[i];
			if (min < a[i])
				min = a[i];
		} int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
			if (max > a[i])
				max = a[i];
			if (min < a[i])
				min = a[i];
		} {
			if (max > a[i])
				max = a[i];
			if (min < a[i])
				min = a[i];
		} if (max > a[i])
				max = a[i]; max > a[i] max a[i] a i max = a[i] max a[i] a i if (min < a[i])
				min = a[i]; min < a[i] min a[i] a i min = a[i] min a[i] a i System.out.println(max+" "+min+" "+sum) System.out.println System.out System System.out max+" "+min+" "+sum " " min max+" "+min+" "+sum max " " min " " sum sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a[] = new int[n];
		long sum = 0;
		for (int i = 0; i < n; i++) {
			a[i]=sc.nextInt();
			sum += a[i];
		}
		int max = a[0];
		int min = a[0];
		for (int i = 1; i < n; i++) {
			if (max > a[i])
				max = a[i];
			if (min < a[i])
				min = a[i];
		}
		System.out.println(max+" "+min+" "+sum);

		sc.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a[] = new int[n];
		long sum = 0;
		for (int i = 0; i < n; i++) {
			a[i]=sc.nextInt();
			sum += a[i];
		}
		int max = a[0];
		int min = a[0];
		for (int i = 1; i < n; i++) {
			if (max > a[i])
				max = a[i];
			if (min < a[i])
				min = a[i];
		}
		System.out.println(max+" "+min+" "+sum);

		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a[] = new int[n];
		long sum = 0;
		for (int i = 0; i < n; i++) {
			a[i]=sc.nextInt();
			sum += a[i];
		}
		int max = a[0];
		int min = a[0];
		for (int i = 1; i < n; i++) {
			if (max > a[i])
				max = a[i];
			if (min < a[i])
				min = a[i];
		}
		System.out.println(max+" "+min+" "+sum);

		sc.close();
	}
}

