import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {

	public static void main(String[] args) throws IOException{
		BufferedReader br =new BufferedReader(new InputStreamReader(System.in));
		String  first = br.readLine();
		int[] array = new int[Integer.parseInt(first)];
		String str = br.readLine();
		String[] stra = str.split(" ");
		for (int i = 0 ; i < array.length ; i++){
			array[i] = Integer.parseInt(stra[i]);
		}
		int max = array[0]; int min = array[0]; long sum = 0;
		for (int x = 0 ; x < array.length ;x++){
			max = Math.max(max, array[x]);
			min = Math.min(min,array[x]);
			sum = sum + array[x];
		}
		System.out.println(min + " " + max + " " + sum);
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) throws IOException{
		BufferedReader br =new BufferedReader(new InputStreamReader(System.in));
		String  first = br.readLine();
		int[] array = new int[Integer.parseInt(first)];
		String str = br.readLine();
		String[] stra = str.split(" ");
		for (int i = 0 ; i < array.length ; i++){
			array[i] = Integer.parseInt(stra[i]);
		}
		int max = array[0]; int min = array[0]; long sum = 0;
		for (int x = 0 ; x < array.length ;x++){
			max = Math.max(max, array[x]);
			min = Math.min(min,array[x]);
			sum = sum + array[x];
		}
		System.out.println(min + " " + max + " " + sum);
	}

} Main public static void main(String[] args) throws IOException{
		BufferedReader br =new BufferedReader(new InputStreamReader(System.in));
		String  first = br.readLine();
		int[] array = new int[Integer.parseInt(first)];
		String str = br.readLine();
		String[] stra = str.split(" ");
		for (int i = 0 ; i < array.length ; i++){
			array[i] = Integer.parseInt(stra[i]);
		}
		int max = array[0]; int min = array[0]; long sum = 0;
		for (int x = 0 ; x < array.length ;x++){
			max = Math.max(max, array[x]);
			min = Math.min(min,array[x]);
			sum = sum + array[x];
		}
		System.out.println(min + " " + max + " " + sum);
	} main {
		BufferedReader br =new BufferedReader(new InputStreamReader(System.in));
		String  first = br.readLine();
		int[] array = new int[Integer.parseInt(first)];
		String str = br.readLine();
		String[] stra = str.split(" ");
		for (int i = 0 ; i < array.length ; i++){
			array[i] = Integer.parseInt(stra[i]);
		}
		int max = array[0]; int min = array[0]; long sum = 0;
		for (int x = 0 ; x < array.length ;x++){
			max = Math.max(max, array[x]);
			min = Math.min(min,array[x]);
			sum = sum + array[x];
		}
		System.out.println(min + " " + max + " " + sum);
	} BufferedReader br =new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String  first = br.readLine(); first br.readLine() br.readLine br int[] array = new int[Integer.parseInt(first)]; array new int[Integer.parseInt(first)] Integer.parseInt(first) Integer.parseInt Integer first String str = br.readLine(); str br.readLine() br.readLine br String[] stra = str.split(" "); stra str.split(" ") str.split str " " for (int i = 0 ; i < array.length ; i++){
			array[i] = Integer.parseInt(stra[i]);
		} int i = 0 ; int i = 0 ; i 0 i < array.length i array.length array array.length i++ i++ i {
			array[i] = Integer.parseInt(stra[i]);
		} {
			array[i] = Integer.parseInt(stra[i]);
		} array[i] = Integer.parseInt(stra[i]) array[i] array i Integer.parseInt(stra[i]) Integer.parseInt Integer stra[i] stra i int max = array[0]; max array[0] array 0 int min = array[0]; min array[0] array 0 long sum = 0; sum 0 for (int x = 0 ; x < array.length ;x++){
			max = Math.max(max, array[x]);
			min = Math.min(min,array[x]);
			sum = sum + array[x];
		} int x = 0 ; int x = 0 ; x 0 x < array.length x array.length array array.length x++ x++ x {
			max = Math.max(max, array[x]);
			min = Math.min(min,array[x]);
			sum = sum + array[x];
		} {
			max = Math.max(max, array[x]);
			min = Math.min(min,array[x]);
			sum = sum + array[x];
		} max = Math.max(max, array[x]) max Math.max(max, array[x]) Math.max Math max array[x] array x min = Math.min(min,array[x]) min Math.min(min,array[x]) Math.min Math min array[x] array x sum = sum + array[x] sum sum + array[x] sum array[x] array x 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) throws IOException{
		BufferedReader br =new BufferedReader(new InputStreamReader(System.in));
		String  first = br.readLine();
		int[] array = new int[Integer.parseInt(first)];
		String str = br.readLine();
		String[] stra = str.split(" ");
		for (int i = 0 ; i < array.length ; i++){
			array[i] = Integer.parseInt(stra[i]);
		}
		int max = array[0]; int min = array[0]; long sum = 0;
		for (int x = 0 ; x < array.length ;x++){
			max = Math.max(max, array[x]);
			min = Math.min(min,array[x]);
			sum = sum + array[x];
		}
		System.out.println(min + " " + max + " " + sum);
	}

} public class Main {

	public static void main(String[] args) throws IOException{
		BufferedReader br =new BufferedReader(new InputStreamReader(System.in));
		String  first = br.readLine();
		int[] array = new int[Integer.parseInt(first)];
		String str = br.readLine();
		String[] stra = str.split(" ");
		for (int i = 0 ; i < array.length ; i++){
			array[i] = Integer.parseInt(stra[i]);
		}
		int max = array[0]; int min = array[0]; long sum = 0;
		for (int x = 0 ; x < array.length ;x++){
			max = Math.max(max, array[x]);
			min = Math.min(min,array[x]);
			sum = sum + array[x];
		}
		System.out.println(min + " " + max + " " + sum);
	}

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {

	public static void main(String[] args) throws IOException{
		BufferedReader br =new BufferedReader(new InputStreamReader(System.in));
		String  first = br.readLine();
		int[] array = new int[Integer.parseInt(first)];
		String str = br.readLine();
		String[] stra = str.split(" ");
		for (int i = 0 ; i < array.length ; i++){
			array[i] = Integer.parseInt(stra[i]);
		}
		int max = array[0]; int min = array[0]; long sum = 0;
		for (int x = 0 ; x < array.length ;x++){
			max = Math.max(max, array[x]);
			min = Math.min(min,array[x]);
			sum = sum + array[x];
		}
		System.out.println(min + " " + max + " " + sum);
	}

}