import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] number = new int[n];
		int max = 0, min = 0;
		long sum = 0;
		for(int i = 0; i < n; i++){
			number[i] = scan.nextInt();
			if(i == 0){
				max = number[0];
				min = number[0];
			}
			if(max < number[i]){
				max = number[i];
			}
			if(min > number[i]){
				min = number[i];
			}
			sum+= number[i];
		}
		System.out.printf("%d %d %d\n", min, max, sum);
	}
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] number = new int[n];
		int max = 0, min = 0;
		long sum = 0;
		for(int i = 0; i < n; i++){
			number[i] = scan.nextInt();
			if(i == 0){
				max = number[0];
				min = number[0];
			}
			if(max < number[i]){
				max = number[i];
			}
			if(min > number[i]){
				min = number[i];
			}
			sum+= number[i];
		}
		System.out.printf("%d %d %d\n", min, max, sum);
	}
} Main public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] number = new int[n];
		int max = 0, min = 0;
		long sum = 0;
		for(int i = 0; i < n; i++){
			number[i] = scan.nextInt();
			if(i == 0){
				max = number[0];
				min = number[0];
			}
			if(max < number[i]){
				max = number[i];
			}
			if(min > number[i]){
				min = number[i];
			}
			sum+= number[i];
		}
		System.out.printf("%d %d %d\n", min, max, sum);
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] number = new int[n];
		int max = 0, min = 0;
		long sum = 0;
		for(int i = 0; i < n; i++){
			number[i] = scan.nextInt();
			if(i == 0){
				max = number[0];
				min = number[0];
			}
			if(max < number[i]){
				max = number[i];
			}
			if(min > number[i]){
				min = number[i];
			}
			sum+= number[i];
		}
		System.out.printf("%d %d %d\n", min, max, sum);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int[] number = new int[n]; number new int[n] n int max = 0 max 0 min = 0; min 0 long sum = 0; sum 0 for(int i = 0; i < n; i++){
			number[i] = scan.nextInt();
			if(i == 0){
				max = number[0];
				min = number[0];
			}
			if(max < number[i]){
				max = number[i];
			}
			if(min > number[i]){
				min = number[i];
			}
			sum+= number[i];
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			number[i] = scan.nextInt();
			if(i == 0){
				max = number[0];
				min = number[0];
			}
			if(max < number[i]){
				max = number[i];
			}
			if(min > number[i]){
				min = number[i];
			}
			sum+= number[i];
		} {
			number[i] = scan.nextInt();
			if(i == 0){
				max = number[0];
				min = number[0];
			}
			if(max < number[i]){
				max = number[i];
			}
			if(min > number[i]){
				min = number[i];
			}
			sum+= number[i];
		} number[i] = scan.nextInt() number[i] number i scan.nextInt() scan.nextInt scan if(i == 0){
				max = number[0];
				min = number[0];
			} i == 0 i 0 {
				max = number[0];
				min = number[0];
			} max = number[0] max number[0] number 0 min = number[0] min number[0] number 0 if(max < number[i]){
				max = number[i];
			} max < number[i] max number[i] number i {
				max = number[i];
			} max = number[i] max number[i] number i if(min > number[i]){
				min = number[i];
			} min > number[i] min number[i] number i {
				min = number[i];
			} min = number[i] min number[i] number i sum+= number[i] sum number[i] number i System.out.printf("%d %d %d\n", min, max, sum) System.out.printf System.out System System.out "%d %d %d\n" min max sum String[] args args public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] number = new int[n];
		int max = 0, min = 0;
		long sum = 0;
		for(int i = 0; i < n; i++){
			number[i] = scan.nextInt();
			if(i == 0){
				max = number[0];
				min = number[0];
			}
			if(max < number[i]){
				max = number[i];
			}
			if(min > number[i]){
				min = number[i];
			}
			sum+= number[i];
		}
		System.out.printf("%d %d %d\n", min, max, sum);
	}
} public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] number = new int[n];
		int max = 0, min = 0;
		long sum = 0;
		for(int i = 0; i < n; i++){
			number[i] = scan.nextInt();
			if(i == 0){
				max = number[0];
				min = number[0];
			}
			if(max < number[i]){
				max = number[i];
			}
			if(min > number[i]){
				min = number[i];
			}
			sum+= number[i];
		}
		System.out.printf("%d %d %d\n", min, max, sum);
	}
} Main
import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] number = new int[n];
		int max = 0, min = 0;
		long sum = 0;
		for(int i = 0; i < n; i++){
			number[i] = scan.nextInt();
			if(i == 0){
				max = number[0];
				min = number[0];
			}
			if(max < number[i]){
				max = number[i];
			}
			if(min > number[i]){
				min = number[i];
			}
			sum+= number[i];
		}
		System.out.printf("%d %d %d\n", min, max, sum);
	}
}