import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String ns = sc.nextLine();
		String[] array = sc.nextLine().split(" ");
		int[] iarray = new int[Integer.parseInt(ns)];
		for (int i = 0; i < array.length; i++) {
			iarray[i] = Integer.parseInt(array[i]);
		}
		long min = iarray[0];
		long max = iarray[0];
		long sum = 0;
		for (int i : iarray) {
			if (min > i) {
				min = i;
			}
			if (i > max) {
				max = i;
			}
			sum += 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);
		String ns = sc.nextLine();
		String[] array = sc.nextLine().split(" ");
		int[] iarray = new int[Integer.parseInt(ns)];
		for (int i = 0; i < array.length; i++) {
			iarray[i] = Integer.parseInt(array[i]);
		}
		long min = iarray[0];
		long max = iarray[0];
		long sum = 0;
		for (int i : iarray) {
			if (min > i) {
				min = i;
			}
			if (i > max) {
				max = i;
			}
			sum += i;
		}
		System.out.println(min + " " + max + " " + sum);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String ns = sc.nextLine();
		String[] array = sc.nextLine().split(" ");
		int[] iarray = new int[Integer.parseInt(ns)];
		for (int i = 0; i < array.length; i++) {
			iarray[i] = Integer.parseInt(array[i]);
		}
		long min = iarray[0];
		long max = iarray[0];
		long sum = 0;
		for (int i : iarray) {
			if (min > i) {
				min = i;
			}
			if (i > max) {
				max = i;
			}
			sum += i;
		}
		System.out.println(min + " " + max + " " + sum);
	} main {
		Scanner sc = new Scanner(System.in);
		String ns = sc.nextLine();
		String[] array = sc.nextLine().split(" ");
		int[] iarray = new int[Integer.parseInt(ns)];
		for (int i = 0; i < array.length; i++) {
			iarray[i] = Integer.parseInt(array[i]);
		}
		long min = iarray[0];
		long max = iarray[0];
		long sum = 0;
		for (int i : iarray) {
			if (min > i) {
				min = i;
			}
			if (i > max) {
				max = i;
			}
			sum += i;
		}
		System.out.println(min + " " + max + " " + sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String ns = sc.nextLine(); ns sc.nextLine() sc.nextLine sc String[] array = sc.nextLine().split(" "); array sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " int[] iarray = new int[Integer.parseInt(ns)]; iarray new int[Integer.parseInt(ns)] Integer.parseInt(ns) Integer.parseInt Integer ns for (int i = 0; i < array.length; i++) {
			iarray[i] = Integer.parseInt(array[i]);
		} int i = 0; int i = 0; i 0 i < array.length i array.length array array.length i++ i++ i {
			iarray[i] = Integer.parseInt(array[i]);
		} {
			iarray[i] = Integer.parseInt(array[i]);
		} iarray[i] = Integer.parseInt(array[i]) iarray[i] iarray i Integer.parseInt(array[i]) Integer.parseInt Integer array[i] array i long min = iarray[0]; min iarray[0] iarray 0 long max = iarray[0]; max iarray[0] iarray 0 long sum = 0; sum 0 for (int i : iarray) {
			if (min > i) {
				min = i;
			}
			if (i > max) {
				max = i;
			}
			sum += i;
		} int i iarray {
			if (min > i) {
				min = i;
			}
			if (i > max) {
				max = i;
			}
			sum += i;
		} {
			if (min > i) {
				min = i;
			}
			if (i > max) {
				max = i;
			}
			sum += i;
		} if (min > i) {
				min = i;
			} min > i min i {
				min = i;
			} min = i min i if (i > max) {
				max = i;
			} i > max i max {
				max = i;
			} max = i max i sum += i sum 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);
		String ns = sc.nextLine();
		String[] array = sc.nextLine().split(" ");
		int[] iarray = new int[Integer.parseInt(ns)];
		for (int i = 0; i < array.length; i++) {
			iarray[i] = Integer.parseInt(array[i]);
		}
		long min = iarray[0];
		long max = iarray[0];
		long sum = 0;
		for (int i : iarray) {
			if (min > i) {
				min = i;
			}
			if (i > max) {
				max = i;
			}
			sum += i;
		}
		System.out.println(min + " " + max + " " + sum);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String ns = sc.nextLine();
		String[] array = sc.nextLine().split(" ");
		int[] iarray = new int[Integer.parseInt(ns)];
		for (int i = 0; i < array.length; i++) {
			iarray[i] = Integer.parseInt(array[i]);
		}
		long min = iarray[0];
		long max = iarray[0];
		long sum = 0;
		for (int i : iarray) {
			if (min > i) {
				min = i;
			}
			if (i > max) {
				max = i;
			}
			sum += 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);
		String ns = sc.nextLine();
		String[] array = sc.nextLine().split(" ");
		int[] iarray = new int[Integer.parseInt(ns)];
		for (int i = 0; i < array.length; i++) {
			iarray[i] = Integer.parseInt(array[i]);
		}
		long min = iarray[0];
		long max = iarray[0];
		long sum = 0;
		for (int i : iarray) {
			if (min > i) {
				min = i;
			}
			if (i > max) {
				max = i;
			}
			sum += i;
		}
		System.out.println(min + " " + max + " " + sum);
	}
}