import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int min = 1000000;
		int max = -1000000;
		long sum = 0;
		
		for (int i = sc.nextInt(); i > 0; i--) {
			int a = sc.nextInt();
			if (a <= min) {
				min = a;
			}
			if (a >= max) {
				max = a;
			}
			sum += a;
		}
		sc.close();
		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 min = 1000000;
		int max = -1000000;
		long sum = 0;
		
		for (int i = sc.nextInt(); i > 0; i--) {
			int a = sc.nextInt();
			if (a <= min) {
				min = a;
			}
			if (a >= max) {
				max = a;
			}
			sum += a;
		}
		sc.close();
		System.out.println(min + " " + max + " " + sum);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int min = 1000000;
		int max = -1000000;
		long sum = 0;
		
		for (int i = sc.nextInt(); i > 0; i--) {
			int a = sc.nextInt();
			if (a <= min) {
				min = a;
			}
			if (a >= max) {
				max = a;
			}
			sum += a;
		}
		sc.close();
		System.out.println(min + " " + max + " " + sum);
	} main {
		Scanner sc = new Scanner(System.in);
		int min = 1000000;
		int max = -1000000;
		long sum = 0;
		
		for (int i = sc.nextInt(); i > 0; i--) {
			int a = sc.nextInt();
			if (a <= min) {
				min = a;
			}
			if (a >= max) {
				max = a;
			}
			sum += a;
		}
		sc.close();
		System.out.println(min + " " + max + " " + sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int min = 1000000; min 1000000 int max = -1000000; max -1000000 1000000 long sum = 0; sum 0 for (int i = sc.nextInt(); i > 0; i--) {
			int a = sc.nextInt();
			if (a <= min) {
				min = a;
			}
			if (a >= max) {
				max = a;
			}
			sum += a;
		} int i = sc.nextInt(); int i = sc.nextInt(); i sc.nextInt() sc.nextInt sc i > 0 i 0 i-- i-- i {
			int a = sc.nextInt();
			if (a <= min) {
				min = a;
			}
			if (a >= max) {
				max = a;
			}
			sum += a;
		} {
			int a = sc.nextInt();
			if (a <= min) {
				min = a;
			}
			if (a >= max) {
				max = a;
			}
			sum += a;
		} int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc if (a <= min) {
				min = a;
			} a <= min a min {
				min = a;
			} min = a min a if (a >= max) {
				max = a;
			} a >= max a max {
				max = a;
			} max = a max a sum += a sum a sc.close() sc.close sc 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 min = 1000000;
		int max = -1000000;
		long sum = 0;
		
		for (int i = sc.nextInt(); i > 0; i--) {
			int a = sc.nextInt();
			if (a <= min) {
				min = a;
			}
			if (a >= max) {
				max = a;
			}
			sum += a;
		}
		sc.close();
		System.out.println(min + " " + max + " " + sum);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int min = 1000000;
		int max = -1000000;
		long sum = 0;
		
		for (int i = sc.nextInt(); i > 0; i--) {
			int a = sc.nextInt();
			if (a <= min) {
				min = a;
			}
			if (a >= max) {
				max = a;
			}
			sum += a;
		}
		sc.close();
		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 min = 1000000;
		int max = -1000000;
		long sum = 0;
		
		for (int i = sc.nextInt(); i > 0; i--) {
			int a = sc.nextInt();
			if (a <= min) {
				min = a;
			}
			if (a >= max) {
				max = a;
			}
			sum += a;
		}
		sc.close();
		System.out.println(min + " " + max + " " + sum);
	}
}