import java.util.Scanner;

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

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long sum = 0;
		int[] x = new int[N];

		for (int i = 0; i < N; i++) {
			x[i] = sc.nextInt();
		}
		int max = x[0];
		int min = x[0];

		for (int i = 0; i < N; i++) {

			if (max < x[i]) {
				max = x[i];
			}

			if (min > x[i]) {
				min = x[i];
			}

			sum = sum + x[i];
		}
		System.out.println(min + " " + max + " " + sum);
	}
} 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();
		long sum = 0;
		int[] x = new int[N];

		for (int i = 0; i < N; i++) {
			x[i] = sc.nextInt();
		}
		int max = x[0];
		int min = x[0];

		for (int i = 0; i < N; i++) {

			if (max < x[i]) {
				max = x[i];
			}

			if (min > x[i]) {
				min = x[i];
			}

			sum = sum + x[i];
		}
		System.out.println(min + " " + max + " " + sum);
	}
} Main public static void main(String args[]){

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long sum = 0;
		int[] x = new int[N];

		for (int i = 0; i < N; i++) {
			x[i] = sc.nextInt();
		}
		int max = x[0];
		int min = x[0];

		for (int i = 0; i < N; i++) {

			if (max < x[i]) {
				max = x[i];
			}

			if (min > x[i]) {
				min = x[i];
			}

			sum = sum + x[i];
		}
		System.out.println(min + " " + max + " " + sum);
	} main {

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long sum = 0;
		int[] x = new int[N];

		for (int i = 0; i < N; i++) {
			x[i] = sc.nextInt();
		}
		int max = x[0];
		int min = x[0];

		for (int i = 0; i < N; i++) {

			if (max < x[i]) {
				max = x[i];
			}

			if (min > x[i]) {
				min = x[i];
			}

			sum = sum + x[i];
		}
		System.out.println(min + " " + max + " " + sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc long sum = 0; sum 0 int[] x = new int[N]; x new int[N] N for (int i = 0; i < N; i++) {
			x[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			x[i] = sc.nextInt();
		} {
			x[i] = sc.nextInt();
		} x[i] = sc.nextInt() x[i] x i sc.nextInt() sc.nextInt sc int max = x[0]; max x[0] x 0 int min = x[0]; min x[0] x 0 for (int i = 0; i < N; i++) {

			if (max < x[i]) {
				max = x[i];
			}

			if (min > x[i]) {
				min = x[i];
			}

			sum = sum + x[i];
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {

			if (max < x[i]) {
				max = x[i];
			}

			if (min > x[i]) {
				min = x[i];
			}

			sum = sum + x[i];
		} {

			if (max < x[i]) {
				max = x[i];
			}

			if (min > x[i]) {
				min = x[i];
			}

			sum = sum + x[i];
		} if (max < x[i]) {
				max = x[i];
			} max < x[i] max x[i] x i {
				max = x[i];
			} max = x[i] max x[i] x i if (min > x[i]) {
				min = x[i];
			} min > x[i] min x[i] x i {
				min = x[i];
			} min = x[i] min x[i] x i sum = sum + x[i] sum sum + x[i] sum x[i] x i System.out.println(min + " " + max + " " + sum) System.out.println System.out System System.out min + " " + max + " " + sum " " max min + " " + max + " " + sum min " " max " " sum String args[] args public class Main{
	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long sum = 0;
		int[] x = new int[N];

		for (int i = 0; i < N; i++) {
			x[i] = sc.nextInt();
		}
		int max = x[0];
		int min = x[0];

		for (int i = 0; i < N; i++) {

			if (max < x[i]) {
				max = x[i];
			}

			if (min > x[i]) {
				min = x[i];
			}

			sum = sum + x[i];
		}
		System.out.println(min + " " + max + " " + sum);
	}
} public class Main{
	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long sum = 0;
		int[] x = new int[N];

		for (int i = 0; i < N; i++) {
			x[i] = sc.nextInt();
		}
		int max = x[0];
		int min = x[0];

		for (int i = 0; i < N; i++) {

			if (max < x[i]) {
				max = x[i];
			}

			if (min > x[i]) {
				min = x[i];
			}

			sum = sum + x[i];
		}
		System.out.println(min + " " + max + " " + sum);
	}
} Main
import java.util.Scanner;

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

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long sum = 0;
		int[] x = new int[N];

		for (int i = 0; i < N; i++) {
			x[i] = sc.nextInt();
		}
		int max = x[0];
		int min = x[0];

		for (int i = 0; i < N; i++) {

			if (max < x[i]) {
				max = x[i];
			}

			if (min > x[i]) {
				min = x[i];
			}

			sum = sum + x[i];
		}
		System.out.println(min + " " + max + " " + sum);
	}
}