import java.io.*;

class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br =
			new BufferedReader(new InputStreamReader(System.in));

	String   input1 = br.readLine();
	String[] input2 = br.readLine().split(" ");

	int size = Integer.parseInt(input1);
	int[] a = new int[size];

	for(int i = 0; i < size; i++) {
		a[i] = Integer.parseInt(input2[i]);
	}

	long min = a[0], MAX = a[0], sum = 0;

	for(int j = 0; j < size; j++) {
		if(a[j] >= MAX) MAX = a[j];
		if(a[j] <= min) min = a[j];
		sum += a[j];
	}
	System.out.println(min + " " + MAX + " " + sum);
	}
} import java.io.*; io.* java class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br =
			new BufferedReader(new InputStreamReader(System.in));

	String   input1 = br.readLine();
	String[] input2 = br.readLine().split(" ");

	int size = Integer.parseInt(input1);
	int[] a = new int[size];

	for(int i = 0; i < size; i++) {
		a[i] = Integer.parseInt(input2[i]);
	}

	long min = a[0], MAX = a[0], sum = 0;

	for(int j = 0; j < size; j++) {
		if(a[j] >= MAX) MAX = a[j];
		if(a[j] <= min) min = a[j];
		sum += a[j];
	}
	System.out.println(min + " " + MAX + " " + sum);
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br =
			new BufferedReader(new InputStreamReader(System.in));

	String   input1 = br.readLine();
	String[] input2 = br.readLine().split(" ");

	int size = Integer.parseInt(input1);
	int[] a = new int[size];

	for(int i = 0; i < size; i++) {
		a[i] = Integer.parseInt(input2[i]);
	}

	long min = a[0], MAX = a[0], sum = 0;

	for(int j = 0; j < size; j++) {
		if(a[j] >= MAX) MAX = a[j];
		if(a[j] <= min) min = a[j];
		sum += a[j];
	}
	System.out.println(min + " " + MAX + " " + sum);
	} main {
		BufferedReader br =
			new BufferedReader(new InputStreamReader(System.in));

	String   input1 = br.readLine();
	String[] input2 = br.readLine().split(" ");

	int size = Integer.parseInt(input1);
	int[] a = new int[size];

	for(int i = 0; i < size; i++) {
		a[i] = Integer.parseInt(input2[i]);
	}

	long min = a[0], MAX = a[0], sum = 0;

	for(int j = 0; j < size; j++) {
		if(a[j] >= MAX) MAX = a[j];
		if(a[j] <= min) min = a[j];
		sum += a[j];
	}
	System.out.println(min + " " + MAX + " " + sum);
	} BufferedReader br =
			new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String   input1 = br.readLine(); input1 br.readLine() br.readLine br String[] input2 = br.readLine().split(" "); input2 br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int size = Integer.parseInt(input1); size Integer.parseInt(input1) Integer.parseInt Integer input1 int[] a = new int[size]; a new int[size] size for(int i = 0; i < size; i++) {
		a[i] = Integer.parseInt(input2[i]);
	} int i = 0; int i = 0; i 0 i < size i size i++ i++ i {
		a[i] = Integer.parseInt(input2[i]);
	} {
		a[i] = Integer.parseInt(input2[i]);
	} a[i] = Integer.parseInt(input2[i]) a[i] a i Integer.parseInt(input2[i]) Integer.parseInt Integer input2[i] input2 i long min = a[0] min a[0] a 0 MAX = a[0] MAX a[0] a 0 sum = 0; sum 0 for(int j = 0; j < size; j++) {
		if(a[j] >= MAX) MAX = a[j];
		if(a[j] <= min) min = a[j];
		sum += a[j];
	} int j = 0; int j = 0; j 0 j < size j size j++ j++ j {
		if(a[j] >= MAX) MAX = a[j];
		if(a[j] <= min) min = a[j];
		sum += a[j];
	} {
		if(a[j] >= MAX) MAX = a[j];
		if(a[j] <= min) min = a[j];
		sum += a[j];
	} if(a[j] >= MAX) MAX = a[j]; a[j] >= MAX a[j] a j MAX MAX = a[j] MAX a[j] a j if(a[j] <= min) min = a[j]; a[j] <= min a[j] a j min min = a[j] min a[j] a j sum += a[j] sum a[j] a j 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
import java.io.*;

class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br =
			new BufferedReader(new InputStreamReader(System.in));

	String   input1 = br.readLine();
	String[] input2 = br.readLine().split(" ");

	int size = Integer.parseInt(input1);
	int[] a = new int[size];

	for(int i = 0; i < size; i++) {
		a[i] = Integer.parseInt(input2[i]);
	}

	long min = a[0], MAX = a[0], sum = 0;

	for(int j = 0; j < size; j++) {
		if(a[j] >= MAX) MAX = a[j];
		if(a[j] <= min) min = a[j];
		sum += a[j];
	}
	System.out.println(min + " " + MAX + " " + sum);
	}
}