import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
		try {
			BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(input.readLine());
			
			String[] line = input.readLine().split(" ");
			int first = Integer.parseInt(line[0]);
			int min = first;
			int max = first;
			long sum = first;
			for (int i = 1; i < n; i++) {
				int a = Integer.parseInt(line[i]);
				if (a < min) min = a;
				if (max < a) max = a;
				sum += a;
			}
			String answer = String.valueOf(min) + " " + String.valueOf(max) + " " + String.valueOf(sum);
			System.out.println(answer);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args) {
		try {
			BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(input.readLine());
			
			String[] line = input.readLine().split(" ");
			int first = Integer.parseInt(line[0]);
			int min = first;
			int max = first;
			long sum = first;
			for (int i = 1; i < n; i++) {
				int a = Integer.parseInt(line[i]);
				if (a < min) min = a;
				if (max < a) max = a;
				sum += a;
			}
			String answer = String.valueOf(min) + " " + String.valueOf(max) + " " + String.valueOf(sum);
			System.out.println(answer);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
} Main public static void main(String[] args) {
		try {
			BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(input.readLine());
			
			String[] line = input.readLine().split(" ");
			int first = Integer.parseInt(line[0]);
			int min = first;
			int max = first;
			long sum = first;
			for (int i = 1; i < n; i++) {
				int a = Integer.parseInt(line[i]);
				if (a < min) min = a;
				if (max < a) max = a;
				sum += a;
			}
			String answer = String.valueOf(min) + " " + String.valueOf(max) + " " + String.valueOf(sum);
			System.out.println(answer);
		} catch (Exception e) {
			e.printStackTrace();
		}
	} main {
		try {
			BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(input.readLine());
			
			String[] line = input.readLine().split(" ");
			int first = Integer.parseInt(line[0]);
			int min = first;
			int max = first;
			long sum = first;
			for (int i = 1; i < n; i++) {
				int a = Integer.parseInt(line[i]);
				if (a < min) min = a;
				if (max < a) max = a;
				sum += a;
			}
			String answer = String.valueOf(min) + " " + String.valueOf(max) + " " + String.valueOf(sum);
			System.out.println(answer);
		} catch (Exception e) {
			e.printStackTrace();
		}
	} try {
			BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(input.readLine());
			
			String[] line = input.readLine().split(" ");
			int first = Integer.parseInt(line[0]);
			int min = first;
			int max = first;
			long sum = first;
			for (int i = 1; i < n; i++) {
				int a = Integer.parseInt(line[i]);
				if (a < min) min = a;
				if (max < a) max = a;
				sum += a;
			}
			String answer = String.valueOf(min) + " " + String.valueOf(max) + " " + String.valueOf(sum);
			System.out.println(answer);
		} catch (Exception e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		} Exception e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(input.readLine());
			
			String[] line = input.readLine().split(" ");
			int first = Integer.parseInt(line[0]);
			int min = first;
			int max = first;
			long sum = first;
			for (int i = 1; i < n; i++) {
				int a = Integer.parseInt(line[i]);
				if (a < min) min = a;
				if (max < a) max = a;
				sum += a;
			}
			String answer = String.valueOf(min) + " " + String.valueOf(max) + " " + String.valueOf(sum);
			System.out.println(answer);
		} BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); input new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(input.readLine()); n Integer.parseInt(input.readLine()) Integer.parseInt Integer input.readLine() input.readLine input String[] line = input.readLine().split(" "); line input.readLine().split(" ") input.readLine().split input.readLine() input.readLine input " " int first = Integer.parseInt(line[0]); first Integer.parseInt(line[0]) Integer.parseInt Integer line[0] line 0 int min = first; min first int max = first; max first long sum = first; sum first for (int i = 1; i < n; i++) {
				int a = Integer.parseInt(line[i]);
				if (a < min) min = a;
				if (max < a) max = a;
				sum += a;
			} int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
				int a = Integer.parseInt(line[i]);
				if (a < min) min = a;
				if (max < a) max = a;
				sum += a;
			} {
				int a = Integer.parseInt(line[i]);
				if (a < min) min = a;
				if (max < a) max = a;
				sum += a;
			} int a = Integer.parseInt(line[i]); a Integer.parseInt(line[i]) Integer.parseInt Integer line[i] line i if (a < min) min = a; a < min a min min = a min a if (max < a) max = a; max < a max a max = a max a sum += a sum a String answer = String.valueOf(min) + " " + String.valueOf(max) + " " + String.valueOf(sum); answer String.valueOf(min) + " " + String.valueOf(max) + " " + String.valueOf(sum) " " String.valueOf(max) String.valueOf(min) + " " + String.valueOf(max) + " " + String.valueOf(sum) String.valueOf(min) String.valueOf String min " " String.valueOf(max) String.valueOf String max " " String.valueOf(sum) String.valueOf String sum System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {
	public static void main(String[] args) {
		try {
			BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(input.readLine());
			
			String[] line = input.readLine().split(" ");
			int first = Integer.parseInt(line[0]);
			int min = first;
			int max = first;
			long sum = first;
			for (int i = 1; i < n; i++) {
				int a = Integer.parseInt(line[i]);
				if (a < min) min = a;
				if (max < a) max = a;
				sum += a;
			}
			String answer = String.valueOf(min) + " " + String.valueOf(max) + " " + String.valueOf(sum);
			System.out.println(answer);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
} public class Main {
	public static void main(String[] args) {
		try {
			BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(input.readLine());
			
			String[] line = input.readLine().split(" ");
			int first = Integer.parseInt(line[0]);
			int min = first;
			int max = first;
			long sum = first;
			for (int i = 1; i < n; i++) {
				int a = Integer.parseInt(line[i]);
				if (a < min) min = a;
				if (max < a) max = a;
				sum += a;
			}
			String answer = String.valueOf(min) + " " + String.valueOf(max) + " " + String.valueOf(sum);
			System.out.println(answer);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
		try {
			BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(input.readLine());
			
			String[] line = input.readLine().split(" ");
			int first = Integer.parseInt(line[0]);
			int min = first;
			int max = first;
			long sum = first;
			for (int i = 1; i < n; i++) {
				int a = Integer.parseInt(line[i]);
				if (a < min) min = a;
				if (max < a) max = a;
				sum += a;
			}
			String answer = String.valueOf(min) + " " + String.valueOf(max) + " " + String.valueOf(sum);
			System.out.println(answer);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}