import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int count = Integer.parseInt(sc.nextLine());
		int[] nums = new int[count];
		String[] lines = sc.nextLine().split(" ");

		for(int i = 0;i < count;i++) {
			nums[i] = Integer.parseInt(lines[i]);
		}
		int min = nums[0];
		int max = nums[0];
		long sum = 0;
		for(int i = 1;i < count ;i++) {
			if(nums[i] < min ) {
				min = nums[i];
			} else if(nums[i] > max) {
				max = nums[i];
			}
		}
		for(int i = 0; i < count ; i++) {
			sum += nums[i];
		}
		System.out.println(min + " " + max + " " + sum);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int count = Integer.parseInt(sc.nextLine());
		int[] nums = new int[count];
		String[] lines = sc.nextLine().split(" ");

		for(int i = 0;i < count;i++) {
			nums[i] = Integer.parseInt(lines[i]);
		}
		int min = nums[0];
		int max = nums[0];
		long sum = 0;
		for(int i = 1;i < count ;i++) {
			if(nums[i] < min ) {
				min = nums[i];
			} else if(nums[i] > max) {
				max = nums[i];
			}
		}
		for(int i = 0; i < count ; i++) {
			sum += nums[i];
		}
		System.out.println(min + " " + max + " " + sum);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int count = Integer.parseInt(sc.nextLine());
		int[] nums = new int[count];
		String[] lines = sc.nextLine().split(" ");

		for(int i = 0;i < count;i++) {
			nums[i] = Integer.parseInt(lines[i]);
		}
		int min = nums[0];
		int max = nums[0];
		long sum = 0;
		for(int i = 1;i < count ;i++) {
			if(nums[i] < min ) {
				min = nums[i];
			} else if(nums[i] > max) {
				max = nums[i];
			}
		}
		for(int i = 0; i < count ; i++) {
			sum += nums[i];
		}
		System.out.println(min + " " + max + " " + sum);
	} main {
		Scanner sc = new Scanner(System.in);
		int count = Integer.parseInt(sc.nextLine());
		int[] nums = new int[count];
		String[] lines = sc.nextLine().split(" ");

		for(int i = 0;i < count;i++) {
			nums[i] = Integer.parseInt(lines[i]);
		}
		int min = nums[0];
		int max = nums[0];
		long sum = 0;
		for(int i = 1;i < count ;i++) {
			if(nums[i] < min ) {
				min = nums[i];
			} else if(nums[i] > max) {
				max = nums[i];
			}
		}
		for(int i = 0; i < count ; i++) {
			sum += nums[i];
		}
		System.out.println(min + " " + max + " " + sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int count = Integer.parseInt(sc.nextLine()); count Integer.parseInt(sc.nextLine()) Integer.parseInt Integer sc.nextLine() sc.nextLine sc int[] nums = new int[count]; nums new int[count] count String[] lines = sc.nextLine().split(" "); lines sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " for(int i = 0;i < count;i++) {
			nums[i] = Integer.parseInt(lines[i]);
		} int i = 0; int i = 0; i 0 i < count i count i++ i++ i {
			nums[i] = Integer.parseInt(lines[i]);
		} {
			nums[i] = Integer.parseInt(lines[i]);
		} nums[i] = Integer.parseInt(lines[i]) nums[i] nums i Integer.parseInt(lines[i]) Integer.parseInt Integer lines[i] lines i int min = nums[0]; min nums[0] nums 0 int max = nums[0]; max nums[0] nums 0 long sum = 0; sum 0 for(int i = 1;i < count ;i++) {
			if(nums[i] < min ) {
				min = nums[i];
			} else if(nums[i] > max) {
				max = nums[i];
			}
		} int i = 1; int i = 1; i 1 i < count i count i++ i++ i {
			if(nums[i] < min ) {
				min = nums[i];
			} else if(nums[i] > max) {
				max = nums[i];
			}
		} {
			if(nums[i] < min ) {
				min = nums[i];
			} else if(nums[i] > max) {
				max = nums[i];
			}
		} if(nums[i] < min ) {
				min = nums[i];
			} else if(nums[i] > max) {
				max = nums[i];
			} nums[i] < min nums[i] nums i min {
				min = nums[i];
			} min = nums[i] min nums[i] nums i if(nums[i] > max) {
				max = nums[i];
			} nums[i] > max nums[i] nums i max {
				max = nums[i];
			} max = nums[i] max nums[i] nums i for(int i = 0; i < count ; i++) {
			sum += nums[i];
		} int i = 0; int i = 0; i 0 i < count i count i++ i++ i {
			sum += nums[i];
		} {
			sum += nums[i];
		} sum += nums[i] sum nums[i] nums 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 sc = new Scanner(System.in);
		int count = Integer.parseInt(sc.nextLine());
		int[] nums = new int[count];
		String[] lines = sc.nextLine().split(" ");

		for(int i = 0;i < count;i++) {
			nums[i] = Integer.parseInt(lines[i]);
		}
		int min = nums[0];
		int max = nums[0];
		long sum = 0;
		for(int i = 1;i < count ;i++) {
			if(nums[i] < min ) {
				min = nums[i];
			} else if(nums[i] > max) {
				max = nums[i];
			}
		}
		for(int i = 0; i < count ; i++) {
			sum += nums[i];
		}
		System.out.println(min + " " + max + " " + sum);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int count = Integer.parseInt(sc.nextLine());
		int[] nums = new int[count];
		String[] lines = sc.nextLine().split(" ");

		for(int i = 0;i < count;i++) {
			nums[i] = Integer.parseInt(lines[i]);
		}
		int min = nums[0];
		int max = nums[0];
		long sum = 0;
		for(int i = 1;i < count ;i++) {
			if(nums[i] < min ) {
				min = nums[i];
			} else if(nums[i] > max) {
				max = nums[i];
			}
		}
		for(int i = 0; i < count ; i++) {
			sum += nums[i];
		}
		System.out.println(min + " " + max + " " + sum);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int count = Integer.parseInt(sc.nextLine());
		int[] nums = new int[count];
		String[] lines = sc.nextLine().split(" ");

		for(int i = 0;i < count;i++) {
			nums[i] = Integer.parseInt(lines[i]);
		}
		int min = nums[0];
		int max = nums[0];
		long sum = 0;
		for(int i = 1;i < count ;i++) {
			if(nums[i] < min ) {
				min = nums[i];
			} else if(nums[i] > max) {
				max = nums[i];
			}
		}
		for(int i = 0; i < count ; i++) {
			sum += nums[i];
		}
		System.out.println(min + " " + max + " " + sum);
	}
}