import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int kaisu = scan.nextInt();
		long[] num= new long[kaisu];
		long max = -1000001;
		long min = 1000001;
		long sum = 0; 

		for(int i = 0; i < kaisu ; i++){
			num[i] = scan.nextLong();
			if(max < num[i]) max = num[i];
			if(min > num[i]) min = num[i];
			sum = sum + num[i];
		}
		System.out.println(min + " " + max + " " + sum);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int kaisu = scan.nextInt();
		long[] num= new long[kaisu];
		long max = -1000001;
		long min = 1000001;
		long sum = 0; 

		for(int i = 0; i < kaisu ; i++){
			num[i] = scan.nextLong();
			if(max < num[i]) max = num[i];
			if(min > num[i]) min = num[i];
			sum = sum + num[i];
		}
		System.out.println(min + " " + max + " " + sum);
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int kaisu = scan.nextInt();
		long[] num= new long[kaisu];
		long max = -1000001;
		long min = 1000001;
		long sum = 0; 

		for(int i = 0; i < kaisu ; i++){
			num[i] = scan.nextLong();
			if(max < num[i]) max = num[i];
			if(min > num[i]) min = num[i];
			sum = sum + num[i];
		}
		System.out.println(min + " " + max + " " + sum);
	} main {
		Scanner scan = new Scanner(System.in);
		int kaisu = scan.nextInt();
		long[] num= new long[kaisu];
		long max = -1000001;
		long min = 1000001;
		long sum = 0; 

		for(int i = 0; i < kaisu ; i++){
			num[i] = scan.nextLong();
			if(max < num[i]) max = num[i];
			if(min > num[i]) min = num[i];
			sum = sum + num[i];
		}
		System.out.println(min + " " + max + " " + sum);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int kaisu = scan.nextInt(); kaisu scan.nextInt() scan.nextInt scan long[] num= new long[kaisu]; num new long[kaisu] kaisu long max = -1000001; max -1000001 1000001 long min = 1000001; min 1000001 long sum = 0; sum 0 for(int i = 0; i < kaisu ; i++){
			num[i] = scan.nextLong();
			if(max < num[i]) max = num[i];
			if(min > num[i]) min = num[i];
			sum = sum + num[i];
		} int i = 0; int i = 0; i 0 i < kaisu i kaisu i++ i++ i {
			num[i] = scan.nextLong();
			if(max < num[i]) max = num[i];
			if(min > num[i]) min = num[i];
			sum = sum + num[i];
		} {
			num[i] = scan.nextLong();
			if(max < num[i]) max = num[i];
			if(min > num[i]) min = num[i];
			sum = sum + num[i];
		} num[i] = scan.nextLong() num[i] num i scan.nextLong() scan.nextLong scan if(max < num[i]) max = num[i]; max < num[i] max num[i] num i max = num[i] max num[i] num i if(min > num[i]) min = num[i]; min > num[i] min num[i] num i min = num[i] min num[i] num i sum = sum + num[i] sum sum + num[i] sum num[i] num 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 kaisu = scan.nextInt();
		long[] num= new long[kaisu];
		long max = -1000001;
		long min = 1000001;
		long sum = 0; 

		for(int i = 0; i < kaisu ; i++){
			num[i] = scan.nextLong();
			if(max < num[i]) max = num[i];
			if(min > num[i]) min = num[i];
			sum = sum + num[i];
		}
		System.out.println(min + " " + max + " " + sum);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int kaisu = scan.nextInt();
		long[] num= new long[kaisu];
		long max = -1000001;
		long min = 1000001;
		long sum = 0; 

		for(int i = 0; i < kaisu ; i++){
			num[i] = scan.nextLong();
			if(max < num[i]) max = num[i];
			if(min > num[i]) min = num[i];
			sum = sum + num[i];
		}
		System.out.println(min + " " + max + " " + sum);
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int kaisu = scan.nextInt();
		long[] num= new long[kaisu];
		long max = -1000001;
		long min = 1000001;
		long sum = 0; 

		for(int i = 0; i < kaisu ; i++){
			num[i] = scan.nextLong();
			if(max < num[i]) max = num[i];
			if(min > num[i]) min = num[i];
			sum = sum + num[i];
		}
		System.out.println(min + " " + max + " " + sum);
	}
}