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

public class Main {
	
	public static void main(String[] args) {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String s = reader.readLine();
			String t = reader.readLine();
			int n = Integer.parseInt(s);
			int[] a = new int[n];
			String[] b = t.split(" ");

			long sum = 0;
			for (int i = 0; i < n; i++) {
				a[i] = Integer.parseInt(b[i]);
				sum += a[i];
			}
			int max = a[0];
			for (int j = 1; j < n; j++) {
				if (max < a[j]) {
					max = a[j];
				}
			}
			
			int min = a[0];
			for (int k = 1; k < n; k++) {
				if (min > a[k]) {
					min = a[k];
				}
			}
			
			System.out.println(min + " " + max + " " + sum);
			
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	
	public static void main(String[] args) {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String s = reader.readLine();
			String t = reader.readLine();
			int n = Integer.parseInt(s);
			int[] a = new int[n];
			String[] b = t.split(" ");

			long sum = 0;
			for (int i = 0; i < n; i++) {
				a[i] = Integer.parseInt(b[i]);
				sum += a[i];
			}
			int max = a[0];
			for (int j = 1; j < n; j++) {
				if (max < a[j]) {
					max = a[j];
				}
			}
			
			int min = a[0];
			for (int k = 1; k < n; k++) {
				if (min > a[k]) {
					min = a[k];
				}
			}
			
			System.out.println(min + " " + max + " " + sum);
			
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

} Main public static void main(String[] args) {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String s = reader.readLine();
			String t = reader.readLine();
			int n = Integer.parseInt(s);
			int[] a = new int[n];
			String[] b = t.split(" ");

			long sum = 0;
			for (int i = 0; i < n; i++) {
				a[i] = Integer.parseInt(b[i]);
				sum += a[i];
			}
			int max = a[0];
			for (int j = 1; j < n; j++) {
				if (max < a[j]) {
					max = a[j];
				}
			}
			
			int min = a[0];
			for (int k = 1; k < n; k++) {
				if (min > a[k]) {
					min = a[k];
				}
			}
			
			System.out.println(min + " " + max + " " + sum);
			
		} catch (IOException e) {
			e.printStackTrace();
		}
	} main {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String s = reader.readLine();
			String t = reader.readLine();
			int n = Integer.parseInt(s);
			int[] a = new int[n];
			String[] b = t.split(" ");

			long sum = 0;
			for (int i = 0; i < n; i++) {
				a[i] = Integer.parseInt(b[i]);
				sum += a[i];
			}
			int max = a[0];
			for (int j = 1; j < n; j++) {
				if (max < a[j]) {
					max = a[j];
				}
			}
			
			int min = a[0];
			for (int k = 1; k < n; k++) {
				if (min > a[k]) {
					min = a[k];
				}
			}
			
			System.out.println(min + " " + max + " " + sum);
			
		} catch (IOException e) {
			e.printStackTrace();
		}
	} try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String s = reader.readLine();
			String t = reader.readLine();
			int n = Integer.parseInt(s);
			int[] a = new int[n];
			String[] b = t.split(" ");

			long sum = 0;
			for (int i = 0; i < n; i++) {
				a[i] = Integer.parseInt(b[i]);
				sum += a[i];
			}
			int max = a[0];
			for (int j = 1; j < n; j++) {
				if (max < a[j]) {
					max = a[j];
				}
			}
			
			int min = a[0];
			for (int k = 1; k < n; k++) {
				if (min > a[k]) {
					min = a[k];
				}
			}
			
			System.out.println(min + " " + max + " " + sum);
			
		} catch (IOException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} IOException e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String s = reader.readLine();
			String t = reader.readLine();
			int n = Integer.parseInt(s);
			int[] a = new int[n];
			String[] b = t.split(" ");

			long sum = 0;
			for (int i = 0; i < n; i++) {
				a[i] = Integer.parseInt(b[i]);
				sum += a[i];
			}
			int max = a[0];
			for (int j = 1; j < n; j++) {
				if (max < a[j]) {
					max = a[j];
				}
			}
			
			int min = a[0];
			for (int k = 1; k < n; k++) {
				if (min > a[k]) {
					min = a[k];
				}
			}
			
			System.out.println(min + " " + max + " " + sum);
			
		} BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) String s = reader.readLine(); s reader.readLine() reader.readLine reader String t = reader.readLine(); t reader.readLine() reader.readLine reader int n = Integer.parseInt(s); n Integer.parseInt(s) Integer.parseInt Integer s int[] a = new int[n]; a new int[n] n String[] b = t.split(" "); b t.split(" ") t.split t " " long sum = 0; sum 0 for (int i = 0; i < n; i++) {
				a[i] = Integer.parseInt(b[i]);
				sum += a[i];
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				a[i] = Integer.parseInt(b[i]);
				sum += a[i];
			} {
				a[i] = Integer.parseInt(b[i]);
				sum += a[i];
			} a[i] = Integer.parseInt(b[i]) a[i] a i Integer.parseInt(b[i]) Integer.parseInt Integer b[i] b i sum += a[i] sum a[i] a i int max = a[0]; max a[0] a 0 for (int j = 1; j < n; j++) {
				if (max < a[j]) {
					max = a[j];
				}
			} int j = 1; int j = 1; j 1 j < n j n j++ j++ j {
				if (max < a[j]) {
					max = a[j];
				}
			} {
				if (max < a[j]) {
					max = a[j];
				}
			} if (max < a[j]) {
					max = a[j];
				} max < a[j] max a[j] a j {
					max = a[j];
				} max = a[j] max a[j] a j int min = a[0]; min a[0] a 0 for (int k = 1; k < n; k++) {
				if (min > a[k]) {
					min = a[k];
				}
			} int k = 1; int k = 1; k 1 k < n k n k++ k++ k {
				if (min > a[k]) {
					min = a[k];
				}
			} {
				if (min > a[k]) {
					min = a[k];
				}
			} if (min > a[k]) {
					min = a[k];
				} min > a[k] min a[k] a k {
					min = a[k];
				} min = a[k] min a[k] a k 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) {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String s = reader.readLine();
			String t = reader.readLine();
			int n = Integer.parseInt(s);
			int[] a = new int[n];
			String[] b = t.split(" ");

			long sum = 0;
			for (int i = 0; i < n; i++) {
				a[i] = Integer.parseInt(b[i]);
				sum += a[i];
			}
			int max = a[0];
			for (int j = 1; j < n; j++) {
				if (max < a[j]) {
					max = a[j];
				}
			}
			
			int min = a[0];
			for (int k = 1; k < n; k++) {
				if (min > a[k]) {
					min = a[k];
				}
			}
			
			System.out.println(min + " " + max + " " + sum);
			
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

} public class Main {
	
	public static void main(String[] args) {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String s = reader.readLine();
			String t = reader.readLine();
			int n = Integer.parseInt(s);
			int[] a = new int[n];
			String[] b = t.split(" ");

			long sum = 0;
			for (int i = 0; i < n; i++) {
				a[i] = Integer.parseInt(b[i]);
				sum += a[i];
			}
			int max = a[0];
			for (int j = 1; j < n; j++) {
				if (max < a[j]) {
					max = a[j];
				}
			}
			
			int min = a[0];
			for (int k = 1; k < n; k++) {
				if (min > a[k]) {
					min = a[k];
				}
			}
			
			System.out.println(min + " " + max + " " + sum);
			
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	
	public static void main(String[] args) {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String s = reader.readLine();
			String t = reader.readLine();
			int n = Integer.parseInt(s);
			int[] a = new int[n];
			String[] b = t.split(" ");

			long sum = 0;
			for (int i = 0; i < n; i++) {
				a[i] = Integer.parseInt(b[i]);
				sum += a[i];
			}
			int max = a[0];
			for (int j = 1; j < n; j++) {
				if (max < a[j]) {
					max = a[j];
				}
			}
			
			int min = a[0];
			for (int k = 1; k < n; k++) {
				if (min > a[k]) {
					min = a[k];
				}
			}
			
			System.out.println(min + " " + max + " " + sum);
			
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}