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