import java.io.*;
import java.math.*;

class Main {
	public static void main(String args[]) throws IOException {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		
		int n = Integer.parseInt(br.readLine());
		
		long min = 0;
		long max = 0;
		long sum = 0;
		long input_num;
		
		String input = br.readLine();
		String[] sz_num = input.split(" ");
		
		for (int i = 0; i < n; i++) {
			int tmp = Integer.parseInt(sz_num[i]);
			
			if (i == 0 || min > tmp) {
				min = tmp;
			}
			if (i == 0 || max < tmp) {
				max = tmp;
			}
			
			sum += Long.valueOf(tmp);
		}
		
		System.out.println(min +" "+ max +" "+ sum);
	}
} import java.io.*; io.* java import java.math.*; math.* java class Main {
	public static void main(String args[]) throws IOException {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		
		int n = Integer.parseInt(br.readLine());
		
		long min = 0;
		long max = 0;
		long sum = 0;
		long input_num;
		
		String input = br.readLine();
		String[] sz_num = input.split(" ");
		
		for (int i = 0; i < n; i++) {
			int tmp = Integer.parseInt(sz_num[i]);
			
			if (i == 0 || min > tmp) {
				min = tmp;
			}
			if (i == 0 || max < tmp) {
				max = tmp;
			}
			
			sum += Long.valueOf(tmp);
		}
		
		System.out.println(min +" "+ max +" "+ sum);
	}
} Main public static void main(String args[]) throws IOException {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		
		int n = Integer.parseInt(br.readLine());
		
		long min = 0;
		long max = 0;
		long sum = 0;
		long input_num;
		
		String input = br.readLine();
		String[] sz_num = input.split(" ");
		
		for (int i = 0; i < n; i++) {
			int tmp = Integer.parseInt(sz_num[i]);
			
			if (i == 0 || min > tmp) {
				min = tmp;
			}
			if (i == 0 || max < tmp) {
				max = tmp;
			}
			
			sum += Long.valueOf(tmp);
		}
		
		System.out.println(min +" "+ max +" "+ sum);
	} main {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		
		int n = Integer.parseInt(br.readLine());
		
		long min = 0;
		long max = 0;
		long sum = 0;
		long input_num;
		
		String input = br.readLine();
		String[] sz_num = input.split(" ");
		
		for (int i = 0; i < n; i++) {
			int tmp = Integer.parseInt(sz_num[i]);
			
			if (i == 0 || min > tmp) {
				min = tmp;
			}
			if (i == 0 || max < tmp) {
				max = tmp;
			}
			
			sum += Long.valueOf(tmp);
		}
		
		System.out.println(min +" "+ max +" "+ sum);
	} InputStreamReader isr = new InputStreamReader(System.in); isr new InputStreamReader(System.in) BufferedReader br = new BufferedReader(isr); br new BufferedReader(isr) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br long min = 0; min 0 long max = 0; max 0 long sum = 0; sum 0 long input_num; input_num String input = br.readLine(); input br.readLine() br.readLine br String[] sz_num = input.split(" "); sz_num input.split(" ") input.split input " " for (int i = 0; i < n; i++) {
			int tmp = Integer.parseInt(sz_num[i]);
			
			if (i == 0 || min > tmp) {
				min = tmp;
			}
			if (i == 0 || max < tmp) {
				max = tmp;
			}
			
			sum += Long.valueOf(tmp);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int tmp = Integer.parseInt(sz_num[i]);
			
			if (i == 0 || min > tmp) {
				min = tmp;
			}
			if (i == 0 || max < tmp) {
				max = tmp;
			}
			
			sum += Long.valueOf(tmp);
		} {
			int tmp = Integer.parseInt(sz_num[i]);
			
			if (i == 0 || min > tmp) {
				min = tmp;
			}
			if (i == 0 || max < tmp) {
				max = tmp;
			}
			
			sum += Long.valueOf(tmp);
		} int tmp = Integer.parseInt(sz_num[i]); tmp Integer.parseInt(sz_num[i]) Integer.parseInt Integer sz_num[i] sz_num i if (i == 0 || min > tmp) {
				min = tmp;
			} i == 0 || min > tmp i == 0 i 0 min > tmp min tmp {
				min = tmp;
			} min = tmp min tmp if (i == 0 || max < tmp) {
				max = tmp;
			} i == 0 || max < tmp i == 0 i 0 max < tmp max tmp {
				max = tmp;
			} max = tmp max tmp sum += Long.valueOf(tmp) sum Long.valueOf(tmp) Long.valueOf Long tmp 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
import java.io.*;
import java.math.*;

class Main {
	public static void main(String args[]) throws IOException {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		
		int n = Integer.parseInt(br.readLine());
		
		long min = 0;
		long max = 0;
		long sum = 0;
		long input_num;
		
		String input = br.readLine();
		String[] sz_num = input.split(" ");
		
		for (int i = 0; i < n; i++) {
			int tmp = Integer.parseInt(sz_num[i]);
			
			if (i == 0 || min > tmp) {
				min = tmp;
			}
			if (i == 0 || max < tmp) {
				max = tmp;
			}
			
			sum += Long.valueOf(tmp);
		}
		
		System.out.println(min +" "+ max +" "+ sum);
	}
}