
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		int n, i, min, max, cnt;
		long sum = 0;
		ArrayList<Integer> I = new ArrayList<Integer>();
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		for(cnt = 0; cnt < n; cnt++){
			i = sc.nextInt();
			I.add(new Integer(i));
		}
		max = I.get(new Integer(0));
		min = I.get(new Integer(0));
		for(cnt = 0; cnt < n; cnt++){
			if(min > I.get(new Integer(cnt))){
				min = I.get(new Integer(cnt));
			}else if(max < I.get(new Integer(cnt))){
				max = I.get(new Integer(cnt));
			}
			sum += I.get(new Integer(cnt));
		}
		System.out.println(min + " " + max + " " + sum);
	}
} import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		int n, i, min, max, cnt;
		long sum = 0;
		ArrayList<Integer> I = new ArrayList<Integer>();
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		for(cnt = 0; cnt < n; cnt++){
			i = sc.nextInt();
			I.add(new Integer(i));
		}
		max = I.get(new Integer(0));
		min = I.get(new Integer(0));
		for(cnt = 0; cnt < n; cnt++){
			if(min > I.get(new Integer(cnt))){
				min = I.get(new Integer(cnt));
			}else if(max < I.get(new Integer(cnt))){
				max = I.get(new Integer(cnt));
			}
			sum += I.get(new Integer(cnt));
		}
		System.out.println(min + " " + max + " " + sum);
	}
} Main public static void main(String[] args) {
		int n, i, min, max, cnt;
		long sum = 0;
		ArrayList<Integer> I = new ArrayList<Integer>();
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		for(cnt = 0; cnt < n; cnt++){
			i = sc.nextInt();
			I.add(new Integer(i));
		}
		max = I.get(new Integer(0));
		min = I.get(new Integer(0));
		for(cnt = 0; cnt < n; cnt++){
			if(min > I.get(new Integer(cnt))){
				min = I.get(new Integer(cnt));
			}else if(max < I.get(new Integer(cnt))){
				max = I.get(new Integer(cnt));
			}
			sum += I.get(new Integer(cnt));
		}
		System.out.println(min + " " + max + " " + sum);
	} main {
		int n, i, min, max, cnt;
		long sum = 0;
		ArrayList<Integer> I = new ArrayList<Integer>();
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		for(cnt = 0; cnt < n; cnt++){
			i = sc.nextInt();
			I.add(new Integer(i));
		}
		max = I.get(new Integer(0));
		min = I.get(new Integer(0));
		for(cnt = 0; cnt < n; cnt++){
			if(min > I.get(new Integer(cnt))){
				min = I.get(new Integer(cnt));
			}else if(max < I.get(new Integer(cnt))){
				max = I.get(new Integer(cnt));
			}
			sum += I.get(new Integer(cnt));
		}
		System.out.println(min + " " + max + " " + sum);
	} int n n i i min min max max cnt; cnt long sum = 0; sum 0 ArrayList<Integer> I = new ArrayList<Integer>(); I new ArrayList<Integer>() Scanner sc = new Scanner(System.in); sc new Scanner(System.in) n = sc.nextInt() n sc.nextInt() sc.nextInt sc for(cnt = 0; cnt < n; cnt++){
			i = sc.nextInt();
			I.add(new Integer(i));
		} cnt = 0; cnt = 0 cnt 0 cnt < n cnt n cnt++ cnt++ cnt {
			i = sc.nextInt();
			I.add(new Integer(i));
		} {
			i = sc.nextInt();
			I.add(new Integer(i));
		} i = sc.nextInt() i sc.nextInt() sc.nextInt sc I.add(new Integer(i)) I.add I new Integer(i) max = I.get(new Integer(0)) max I.get(new Integer(0)) I.get I new Integer(0) min = I.get(new Integer(0)) min I.get(new Integer(0)) I.get I new Integer(0) for(cnt = 0; cnt < n; cnt++){
			if(min > I.get(new Integer(cnt))){
				min = I.get(new Integer(cnt));
			}else if(max < I.get(new Integer(cnt))){
				max = I.get(new Integer(cnt));
			}
			sum += I.get(new Integer(cnt));
		} cnt = 0; cnt = 0 cnt 0 cnt < n cnt n cnt++ cnt++ cnt {
			if(min > I.get(new Integer(cnt))){
				min = I.get(new Integer(cnt));
			}else if(max < I.get(new Integer(cnt))){
				max = I.get(new Integer(cnt));
			}
			sum += I.get(new Integer(cnt));
		} {
			if(min > I.get(new Integer(cnt))){
				min = I.get(new Integer(cnt));
			}else if(max < I.get(new Integer(cnt))){
				max = I.get(new Integer(cnt));
			}
			sum += I.get(new Integer(cnt));
		} if(min > I.get(new Integer(cnt))){
				min = I.get(new Integer(cnt));
			}else if(max < I.get(new Integer(cnt))){
				max = I.get(new Integer(cnt));
			} min > I.get(new Integer(cnt)) min I.get(new Integer(cnt)) I.get I new Integer(cnt) {
				min = I.get(new Integer(cnt));
			} min = I.get(new Integer(cnt)) min I.get(new Integer(cnt)) I.get I new Integer(cnt) if(max < I.get(new Integer(cnt))){
				max = I.get(new Integer(cnt));
			} max < I.get(new Integer(cnt)) max I.get(new Integer(cnt)) I.get I new Integer(cnt) {
				max = I.get(new Integer(cnt));
			} max = I.get(new Integer(cnt)) max I.get(new Integer(cnt)) I.get I new Integer(cnt) sum += I.get(new Integer(cnt)) sum I.get(new Integer(cnt)) I.get I new Integer(cnt) 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) {
		int n, i, min, max, cnt;
		long sum = 0;
		ArrayList<Integer> I = new ArrayList<Integer>();
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		for(cnt = 0; cnt < n; cnt++){
			i = sc.nextInt();
			I.add(new Integer(i));
		}
		max = I.get(new Integer(0));
		min = I.get(new Integer(0));
		for(cnt = 0; cnt < n; cnt++){
			if(min > I.get(new Integer(cnt))){
				min = I.get(new Integer(cnt));
			}else if(max < I.get(new Integer(cnt))){
				max = I.get(new Integer(cnt));
			}
			sum += I.get(new Integer(cnt));
		}
		System.out.println(min + " " + max + " " + sum);
	}
} public class Main {
	public static void main(String[] args) {
		int n, i, min, max, cnt;
		long sum = 0;
		ArrayList<Integer> I = new ArrayList<Integer>();
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		for(cnt = 0; cnt < n; cnt++){
			i = sc.nextInt();
			I.add(new Integer(i));
		}
		max = I.get(new Integer(0));
		min = I.get(new Integer(0));
		for(cnt = 0; cnt < n; cnt++){
			if(min > I.get(new Integer(cnt))){
				min = I.get(new Integer(cnt));
			}else if(max < I.get(new Integer(cnt))){
				max = I.get(new Integer(cnt));
			}
			sum += I.get(new Integer(cnt));
		}
		System.out.println(min + " " + max + " " + sum);
	}
} Main

import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		int n, i, min, max, cnt;
		long sum = 0;
		ArrayList<Integer> I = new ArrayList<Integer>();
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		for(cnt = 0; cnt < n; cnt++){
			i = sc.nextInt();
			I.add(new Integer(i));
		}
		max = I.get(new Integer(0));
		min = I.get(new Integer(0));
		for(cnt = 0; cnt < n; cnt++){
			if(min > I.get(new Integer(cnt))){
				min = I.get(new Integer(cnt));
			}else if(max < I.get(new Integer(cnt))){
				max = I.get(new Integer(cnt));
			}
			sum += I.get(new Integer(cnt));
		}
		System.out.println(min + " " + max + " " + sum);
	}
}