import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		int min = 1000000;
		int max = -1000000;
		long sum = 0;
		try (Scanner sc = new Scanner(System.in)) {
			int n = sc.nextInt();
			if (n < 0 || n > 10000) {
				throw new RuntimeException();
			}
			int ai;
			for (int i = 1; i <= n; i++) {
				ai = sc.nextInt();
				if (ai < min) {
					min = ai;
				}
				if (ai > max) {
					max = ai;
				}
				sum += ai;
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		System.out.printf("%d %d %d\n", min, max, sum);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		int min = 1000000;
		int max = -1000000;
		long sum = 0;
		try (Scanner sc = new Scanner(System.in)) {
			int n = sc.nextInt();
			if (n < 0 || n > 10000) {
				throw new RuntimeException();
			}
			int ai;
			for (int i = 1; i <= n; i++) {
				ai = sc.nextInt();
				if (ai < min) {
					min = ai;
				}
				if (ai > max) {
					max = ai;
				}
				sum += ai;
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		System.out.printf("%d %d %d\n", min, max, sum);
	}
} Main public static void main(String[] args) {
		int min = 1000000;
		int max = -1000000;
		long sum = 0;
		try (Scanner sc = new Scanner(System.in)) {
			int n = sc.nextInt();
			if (n < 0 || n > 10000) {
				throw new RuntimeException();
			}
			int ai;
			for (int i = 1; i <= n; i++) {
				ai = sc.nextInt();
				if (ai < min) {
					min = ai;
				}
				if (ai > max) {
					max = ai;
				}
				sum += ai;
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		System.out.printf("%d %d %d\n", min, max, sum);
	} main {
		int min = 1000000;
		int max = -1000000;
		long sum = 0;
		try (Scanner sc = new Scanner(System.in)) {
			int n = sc.nextInt();
			if (n < 0 || n > 10000) {
				throw new RuntimeException();
			}
			int ai;
			for (int i = 1; i <= n; i++) {
				ai = sc.nextInt();
				if (ai < min) {
					min = ai;
				}
				if (ai > max) {
					max = ai;
				}
				sum += ai;
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		System.out.printf("%d %d %d\n", min, max, sum);
	} int min = 1000000; min 1000000 int max = -1000000; max -1000000 1000000 long sum = 0; sum 0 try (Scanner sc = new Scanner(System.in)) {
			int n = sc.nextInt();
			if (n < 0 || n > 10000) {
				throw new RuntimeException();
			}
			int ai;
			for (int i = 1; i <= n; i++) {
				ai = sc.nextInt();
				if (ai < min) {
					min = ai;
				}
				if (ai > max) {
					max = ai;
				}
				sum += ai;
			}
		} catch (Exception e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		} Exception e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			int n = sc.nextInt();
			if (n < 0 || n > 10000) {
				throw new RuntimeException();
			}
			int ai;
			for (int i = 1; i <= n; i++) {
				ai = sc.nextInt();
				if (ai < min) {
					min = ai;
				}
				if (ai > max) {
					max = ai;
				}
				sum += ai;
			}
		} Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc if (n < 0 || n > 10000) {
				throw new RuntimeException();
			} n < 0 || n > 10000 n < 0 n 0 n > 10000 n 10000 {
				throw new RuntimeException();
			} throw new RuntimeException(); new RuntimeException() int ai; ai for (int i = 1; i <= n; i++) {
				ai = sc.nextInt();
				if (ai < min) {
					min = ai;
				}
				if (ai > max) {
					max = ai;
				}
				sum += ai;
			} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
				ai = sc.nextInt();
				if (ai < min) {
					min = ai;
				}
				if (ai > max) {
					max = ai;
				}
				sum += ai;
			} {
				ai = sc.nextInt();
				if (ai < min) {
					min = ai;
				}
				if (ai > max) {
					max = ai;
				}
				sum += ai;
			} ai = sc.nextInt() ai sc.nextInt() sc.nextInt sc if (ai < min) {
					min = ai;
				} ai < min ai min {
					min = ai;
				} min = ai min ai if (ai > max) {
					max = ai;
				} ai > max ai max {
					max = ai;
				} max = ai max ai sum += ai sum ai System.out.printf("%d %d %d\n", min, max, sum) System.out.printf System.out System System.out "%d %d %d\n" min max sum String[] args args public class Main {
	public static void main(String[] args) {
		int min = 1000000;
		int max = -1000000;
		long sum = 0;
		try (Scanner sc = new Scanner(System.in)) {
			int n = sc.nextInt();
			if (n < 0 || n > 10000) {
				throw new RuntimeException();
			}
			int ai;
			for (int i = 1; i <= n; i++) {
				ai = sc.nextInt();
				if (ai < min) {
					min = ai;
				}
				if (ai > max) {
					max = ai;
				}
				sum += ai;
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		System.out.printf("%d %d %d\n", min, max, sum);
	}
} public class Main {
	public static void main(String[] args) {
		int min = 1000000;
		int max = -1000000;
		long sum = 0;
		try (Scanner sc = new Scanner(System.in)) {
			int n = sc.nextInt();
			if (n < 0 || n > 10000) {
				throw new RuntimeException();
			}
			int ai;
			for (int i = 1; i <= n; i++) {
				ai = sc.nextInt();
				if (ai < min) {
					min = ai;
				}
				if (ai > max) {
					max = ai;
				}
				sum += ai;
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		System.out.printf("%d %d %d\n", min, max, sum);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		int min = 1000000;
		int max = -1000000;
		long sum = 0;
		try (Scanner sc = new Scanner(System.in)) {
			int n = sc.nextInt();
			if (n < 0 || n > 10000) {
				throw new RuntimeException();
			}
			int ai;
			for (int i = 1; i <= n; i++) {
				ai = sc.nextInt();
				if (ai < min) {
					min = ai;
				}
				if (ai > max) {
					max = ai;
				}
				sum += ai;
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		System.out.printf("%d %d %d\n", min, max, sum);
	}
}