import java.io.File;
import java.io.IOException;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Deque;
import java.util.Scanner;

public class Main {
 
	public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int min = 1000000;
		int max = -1000000;
		long sum = 0;
		for(int i = 0; i < n; i++){
			int in = sc.nextInt();
			sum += in;
			if(in < min) min = in;
			if(in > max) max = in;
		}
		System.out.println(min + " " + max + " " + sum);
	}
} import java.io.File; File java.io import java.io.IOException; IOException java.io import java.util.ArrayDeque; ArrayDeque java.util import java.util.ArrayList; ArrayList java.util import java.util.Deque; Deque java.util import java.util.Scanner; Scanner java.util public class Main {
 
	public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int min = 1000000;
		int max = -1000000;
		long sum = 0;
		for(int i = 0; i < n; i++){
			int in = sc.nextInt();
			sum += in;
			if(in < min) min = in;
			if(in > max) max = in;
		}
		System.out.println(min + " " + max + " " + sum);
	}
} Main public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int min = 1000000;
		int max = -1000000;
		long sum = 0;
		for(int i = 0; i < n; i++){
			int in = sc.nextInt();
			sum += in;
			if(in < min) min = in;
			if(in > max) max = in;
		}
		System.out.println(min + " " + max + " " + sum);
	} main {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int min = 1000000;
		int max = -1000000;
		long sum = 0;
		for(int i = 0; i < n; i++){
			int in = sc.nextInt();
			sum += in;
			if(in < min) min = in;
			if(in > max) max = in;
		}
		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 int min = 1000000; min 1000000 int max = -1000000; max -1000000 1000000 long sum = 0; sum 0 for(int i = 0; i < n; i++){
			int in = sc.nextInt();
			sum += in;
			if(in < min) min = in;
			if(in > max) max = in;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int in = sc.nextInt();
			sum += in;
			if(in < min) min = in;
			if(in > max) max = in;
		} {
			int in = sc.nextInt();
			sum += in;
			if(in < min) min = in;
			if(in > max) max = in;
		} int in = sc.nextInt(); in sc.nextInt() sc.nextInt sc sum += in sum in if(in < min) min = in; in < min in min min = in min in if(in > max) max = in; in > max in max max = in max in 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 {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int min = 1000000;
		int max = -1000000;
		long sum = 0;
		for(int i = 0; i < n; i++){
			int in = sc.nextInt();
			sum += in;
			if(in < min) min = in;
			if(in > max) max = in;
		}
		System.out.println(min + " " + max + " " + sum);
	}
} public class Main {
 
	public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int min = 1000000;
		int max = -1000000;
		long sum = 0;
		for(int i = 0; i < n; i++){
			int in = sc.nextInt();
			sum += in;
			if(in < min) min = in;
			if(in > max) max = in;
		}
		System.out.println(min + " " + max + " " + sum);
	}
} Main
import java.io.File;
import java.io.IOException;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Deque;
import java.util.Scanner;

public class Main {
 
	public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int min = 1000000;
		int max = -1000000;
		long sum = 0;
		for(int i = 0; i < n; i++){
			int in = sc.nextInt();
			sum += in;
			if(in < min) min = in;
			if(in > max) max = in;
		}
		System.out.println(min + " " + max + " " + sum);
	}
}
