import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = br.readLine();

		int kazu = Integer.parseInt(line);
		line = br.readLine();

		String[] keisanStr = line.split("[\\s]+");
		int[] keisanInt = new int[kazu];
		for (int i = 0; i < kazu; i++) {
			keisanInt[i] = Integer.parseInt(keisanStr[i]);
			// System.out.println(keisanInt[i]);
		}

		int min = keisanInt[0];
		int max = keisanInt[0];
		long sum = keisanInt[0];

		for (int q = 1; q < kazu; q++) {
			sum += keisanInt[q];

			if (min > keisanInt[q]) {
				min = keisanInt[q];
			} else if (max < keisanInt[q]) {
				max = keisanInt[q];
			}
		}
		System.out.println(min + " " + max + " " + sum);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = br.readLine();

		int kazu = Integer.parseInt(line);
		line = br.readLine();

		String[] keisanStr = line.split("[\\s]+");
		int[] keisanInt = new int[kazu];
		for (int i = 0; i < kazu; i++) {
			keisanInt[i] = Integer.parseInt(keisanStr[i]);
			// System.out.println(keisanInt[i]);
		}

		int min = keisanInt[0];
		int max = keisanInt[0];
		long sum = keisanInt[0];

		for (int q = 1; q < kazu; q++) {
			sum += keisanInt[q];

			if (min > keisanInt[q]) {
				min = keisanInt[q];
			} else if (max < keisanInt[q]) {
				max = keisanInt[q];
			}
		}
		System.out.println(min + " " + max + " " + sum);
	}
} Main public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = br.readLine();

		int kazu = Integer.parseInt(line);
		line = br.readLine();

		String[] keisanStr = line.split("[\\s]+");
		int[] keisanInt = new int[kazu];
		for (int i = 0; i < kazu; i++) {
			keisanInt[i] = Integer.parseInt(keisanStr[i]);
			// System.out.println(keisanInt[i]);
		}

		int min = keisanInt[0];
		int max = keisanInt[0];
		long sum = keisanInt[0];

		for (int q = 1; q < kazu; q++) {
			sum += keisanInt[q];

			if (min > keisanInt[q]) {
				min = keisanInt[q];
			} else if (max < keisanInt[q]) {
				max = keisanInt[q];
			}
		}
		System.out.println(min + " " + max + " " + sum);
	} main {
		// TODO ?????????????????????????????????????????????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = br.readLine();

		int kazu = Integer.parseInt(line);
		line = br.readLine();

		String[] keisanStr = line.split("[\\s]+");
		int[] keisanInt = new int[kazu];
		for (int i = 0; i < kazu; i++) {
			keisanInt[i] = Integer.parseInt(keisanStr[i]);
			// System.out.println(keisanInt[i]);
		}

		int min = keisanInt[0];
		int max = keisanInt[0];
		long sum = keisanInt[0];

		for (int q = 1; q < kazu; q++) {
			sum += keisanInt[q];

			if (min > keisanInt[q]) {
				min = keisanInt[q];
			} else if (max < keisanInt[q]) {
				max = keisanInt[q];
			}
		}
		System.out.println(min + " " + max + " " + sum);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String line = br.readLine(); line br.readLine() br.readLine br int kazu = Integer.parseInt(line); kazu Integer.parseInt(line) Integer.parseInt Integer line line = br.readLine() line br.readLine() br.readLine br String[] keisanStr = line.split("[\\s]+"); keisanStr line.split("[\\s]+") line.split line "[\\s]+" int[] keisanInt = new int[kazu]; keisanInt new int[kazu] kazu for (int i = 0; i < kazu; i++) {
			keisanInt[i] = Integer.parseInt(keisanStr[i]);
			// System.out.println(keisanInt[i]);
		} int i = 0; int i = 0; i 0 i < kazu i kazu i++ i++ i {
			keisanInt[i] = Integer.parseInt(keisanStr[i]);
			// System.out.println(keisanInt[i]);
		} {
			keisanInt[i] = Integer.parseInt(keisanStr[i]);
			// System.out.println(keisanInt[i]);
		} keisanInt[i] = Integer.parseInt(keisanStr[i]) keisanInt[i] keisanInt i Integer.parseInt(keisanStr[i]) Integer.parseInt Integer keisanStr[i] keisanStr i int min = keisanInt[0]; min keisanInt[0] keisanInt 0 int max = keisanInt[0]; max keisanInt[0] keisanInt 0 long sum = keisanInt[0]; sum keisanInt[0] keisanInt 0 for (int q = 1; q < kazu; q++) {
			sum += keisanInt[q];

			if (min > keisanInt[q]) {
				min = keisanInt[q];
			} else if (max < keisanInt[q]) {
				max = keisanInt[q];
			}
		} int q = 1; int q = 1; q 1 q < kazu q kazu q++ q++ q {
			sum += keisanInt[q];

			if (min > keisanInt[q]) {
				min = keisanInt[q];
			} else if (max < keisanInt[q]) {
				max = keisanInt[q];
			}
		} {
			sum += keisanInt[q];

			if (min > keisanInt[q]) {
				min = keisanInt[q];
			} else if (max < keisanInt[q]) {
				max = keisanInt[q];
			}
		} sum += keisanInt[q] sum keisanInt[q] keisanInt q if (min > keisanInt[q]) {
				min = keisanInt[q];
			} else if (max < keisanInt[q]) {
				max = keisanInt[q];
			} min > keisanInt[q] min keisanInt[q] keisanInt q {
				min = keisanInt[q];
			} min = keisanInt[q] min keisanInt[q] keisanInt q if (max < keisanInt[q]) {
				max = keisanInt[q];
			} max < keisanInt[q] max keisanInt[q] keisanInt q {
				max = keisanInt[q];
			} max = keisanInt[q] max keisanInt[q] keisanInt q 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) throws Exception {
		// TODO ?????????????????????????????????????????????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = br.readLine();

		int kazu = Integer.parseInt(line);
		line = br.readLine();

		String[] keisanStr = line.split("[\\s]+");
		int[] keisanInt = new int[kazu];
		for (int i = 0; i < kazu; i++) {
			keisanInt[i] = Integer.parseInt(keisanStr[i]);
			// System.out.println(keisanInt[i]);
		}

		int min = keisanInt[0];
		int max = keisanInt[0];
		long sum = keisanInt[0];

		for (int q = 1; q < kazu; q++) {
			sum += keisanInt[q];

			if (min > keisanInt[q]) {
				min = keisanInt[q];
			} else if (max < keisanInt[q]) {
				max = keisanInt[q];
			}
		}
		System.out.println(min + " " + max + " " + sum);
	}
} public class Main {

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = br.readLine();

		int kazu = Integer.parseInt(line);
		line = br.readLine();

		String[] keisanStr = line.split("[\\s]+");
		int[] keisanInt = new int[kazu];
		for (int i = 0; i < kazu; i++) {
			keisanInt[i] = Integer.parseInt(keisanStr[i]);
			// System.out.println(keisanInt[i]);
		}

		int min = keisanInt[0];
		int max = keisanInt[0];
		long sum = keisanInt[0];

		for (int q = 1; q < kazu; q++) {
			sum += keisanInt[q];

			if (min > keisanInt[q]) {
				min = keisanInt[q];
			} else if (max < keisanInt[q]) {
				max = keisanInt[q];
			}
		}
		System.out.println(min + " " + max + " " + sum);
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = br.readLine();

		int kazu = Integer.parseInt(line);
		line = br.readLine();

		String[] keisanStr = line.split("[\\s]+");
		int[] keisanInt = new int[kazu];
		for (int i = 0; i < kazu; i++) {
			keisanInt[i] = Integer.parseInt(keisanStr[i]);
			// System.out.println(keisanInt[i]);
		}

		int min = keisanInt[0];
		int max = keisanInt[0];
		long sum = keisanInt[0];

		for (int q = 1; q < kazu; q++) {
			sum += keisanInt[q];

			if (min > keisanInt[q]) {
				min = keisanInt[q];
			} else if (max < keisanInt[q]) {
				max = keisanInt[q];
			}
		}
		System.out.println(min + " " + max + " " + sum);
	}
}