import java.util.Scanner;
import java.lang.Math;
public class Main{
    public static void main(String[] args) {
	Scanner scan = new Scanner(System.in);
	int n = Integer.parseInt(scan.nextLine());
	String input = scan.nextLine();
	String[] inputs = input.split(" ");
	int[] numbers = new int[n];
	for (int i = 0; i < n; i++) {
	    numbers[i] = Integer.parseInt(inputs[i]);
	}
	int min = 1000000;
	int max = -1000000;
	long sum = 0;
	for (int i = 0; i < n; i++) {
	    if (min > numbers[i]) {
		min = numbers[i];
	    }
	    if (max < numbers[i]) {
		max = numbers[i];
	    }
	    sum += (long)numbers[i];
	}
	System.out.println(min + " " + max + " " + sum);
    }
} import java.util.Scanner; Scanner java.util import java.lang.Math; Math java.lang public class Main{
    public static void main(String[] args) {
	Scanner scan = new Scanner(System.in);
	int n = Integer.parseInt(scan.nextLine());
	String input = scan.nextLine();
	String[] inputs = input.split(" ");
	int[] numbers = new int[n];
	for (int i = 0; i < n; i++) {
	    numbers[i] = Integer.parseInt(inputs[i]);
	}
	int min = 1000000;
	int max = -1000000;
	long sum = 0;
	for (int i = 0; i < n; i++) {
	    if (min > numbers[i]) {
		min = numbers[i];
	    }
	    if (max < numbers[i]) {
		max = numbers[i];
	    }
	    sum += (long)numbers[i];
	}
	System.out.println(min + " " + max + " " + sum);
    }
} Main public static void main(String[] args) {
	Scanner scan = new Scanner(System.in);
	int n = Integer.parseInt(scan.nextLine());
	String input = scan.nextLine();
	String[] inputs = input.split(" ");
	int[] numbers = new int[n];
	for (int i = 0; i < n; i++) {
	    numbers[i] = Integer.parseInt(inputs[i]);
	}
	int min = 1000000;
	int max = -1000000;
	long sum = 0;
	for (int i = 0; i < n; i++) {
	    if (min > numbers[i]) {
		min = numbers[i];
	    }
	    if (max < numbers[i]) {
		max = numbers[i];
	    }
	    sum += (long)numbers[i];
	}
	System.out.println(min + " " + max + " " + sum);
    } main {
	Scanner scan = new Scanner(System.in);
	int n = Integer.parseInt(scan.nextLine());
	String input = scan.nextLine();
	String[] inputs = input.split(" ");
	int[] numbers = new int[n];
	for (int i = 0; i < n; i++) {
	    numbers[i] = Integer.parseInt(inputs[i]);
	}
	int min = 1000000;
	int max = -1000000;
	long sum = 0;
	for (int i = 0; i < n; i++) {
	    if (min > numbers[i]) {
		min = numbers[i];
	    }
	    if (max < numbers[i]) {
		max = numbers[i];
	    }
	    sum += (long)numbers[i];
	}
	System.out.println(min + " " + max + " " + sum);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = Integer.parseInt(scan.nextLine()); n Integer.parseInt(scan.nextLine()) Integer.parseInt Integer scan.nextLine() scan.nextLine scan String input = scan.nextLine(); input scan.nextLine() scan.nextLine scan String[] inputs = input.split(" "); inputs input.split(" ") input.split input " " int[] numbers = new int[n]; numbers new int[n] n for (int i = 0; i < n; i++) {
	    numbers[i] = Integer.parseInt(inputs[i]);
	} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
	    numbers[i] = Integer.parseInt(inputs[i]);
	} {
	    numbers[i] = Integer.parseInt(inputs[i]);
	} numbers[i] = Integer.parseInt(inputs[i]) numbers[i] numbers i Integer.parseInt(inputs[i]) Integer.parseInt Integer inputs[i] inputs i int min = 1000000; min 1000000 int max = -1000000; max -1000000 1000000 long sum = 0; sum 0 for (int i = 0; i < n; i++) {
	    if (min > numbers[i]) {
		min = numbers[i];
	    }
	    if (max < numbers[i]) {
		max = numbers[i];
	    }
	    sum += (long)numbers[i];
	} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
	    if (min > numbers[i]) {
		min = numbers[i];
	    }
	    if (max < numbers[i]) {
		max = numbers[i];
	    }
	    sum += (long)numbers[i];
	} {
	    if (min > numbers[i]) {
		min = numbers[i];
	    }
	    if (max < numbers[i]) {
		max = numbers[i];
	    }
	    sum += (long)numbers[i];
	} if (min > numbers[i]) {
		min = numbers[i];
	    } min > numbers[i] min numbers[i] numbers i {
		min = numbers[i];
	    } min = numbers[i] min numbers[i] numbers i if (max < numbers[i]) {
		max = numbers[i];
	    } max < numbers[i] max numbers[i] numbers i {
		max = numbers[i];
	    } max = numbers[i] max numbers[i] numbers i sum += (long)numbers[i] sum (long)numbers[i] numbers 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 scan = new Scanner(System.in);
	int n = Integer.parseInt(scan.nextLine());
	String input = scan.nextLine();
	String[] inputs = input.split(" ");
	int[] numbers = new int[n];
	for (int i = 0; i < n; i++) {
	    numbers[i] = Integer.parseInt(inputs[i]);
	}
	int min = 1000000;
	int max = -1000000;
	long sum = 0;
	for (int i = 0; i < n; i++) {
	    if (min > numbers[i]) {
		min = numbers[i];
	    }
	    if (max < numbers[i]) {
		max = numbers[i];
	    }
	    sum += (long)numbers[i];
	}
	System.out.println(min + " " + max + " " + sum);
    }
} public class Main{
    public static void main(String[] args) {
	Scanner scan = new Scanner(System.in);
	int n = Integer.parseInt(scan.nextLine());
	String input = scan.nextLine();
	String[] inputs = input.split(" ");
	int[] numbers = new int[n];
	for (int i = 0; i < n; i++) {
	    numbers[i] = Integer.parseInt(inputs[i]);
	}
	int min = 1000000;
	int max = -1000000;
	long sum = 0;
	for (int i = 0; i < n; i++) {
	    if (min > numbers[i]) {
		min = numbers[i];
	    }
	    if (max < numbers[i]) {
		max = numbers[i];
	    }
	    sum += (long)numbers[i];
	}
	System.out.println(min + " " + max + " " + sum);
    }
} Main
import java.util.Scanner;
import java.lang.Math;
public class Main{
    public static void main(String[] args) {
	Scanner scan = new Scanner(System.in);
	int n = Integer.parseInt(scan.nextLine());
	String input = scan.nextLine();
	String[] inputs = input.split(" ");
	int[] numbers = new int[n];
	for (int i = 0; i < n; i++) {
	    numbers[i] = Integer.parseInt(inputs[i]);
	}
	int min = 1000000;
	int max = -1000000;
	long sum = 0;
	for (int i = 0; i < n; i++) {
	    if (min > numbers[i]) {
		min = numbers[i];
	    }
	    if (max < numbers[i]) {
		max = numbers[i];
	    }
	    sum += (long)numbers[i];
	}
	System.out.println(min + " " + max + " " + sum);
    }
}