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

public class Main {

	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str;
		String[] arrStr;
		try {
			// 1 line
			str = br.readLine();
			int[] arr = new int[Integer.parseInt(str)];

			// 2 line
			str = br.readLine();
			arrStr = str.split(" ");

			for(int i=0;i<arrStr.length;i++){
				arr[i] = Integer.parseInt(arrStr[i]);
			}

			int min = Integer.MAX_VALUE;
			int max = Integer.MIN_VALUE;
			long sum = 0;
			for(int num :arr){
				min = min > num ? num : min;
				max = max < num ? num : max;
				sum += num;
			}

			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) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str;
		String[] arrStr;
		try {
			// 1 line
			str = br.readLine();
			int[] arr = new int[Integer.parseInt(str)];

			// 2 line
			str = br.readLine();
			arrStr = str.split(" ");

			for(int i=0;i<arrStr.length;i++){
				arr[i] = Integer.parseInt(arrStr[i]);
			}

			int min = Integer.MAX_VALUE;
			int max = Integer.MIN_VALUE;
			long sum = 0;
			for(int num :arr){
				min = min > num ? num : min;
				max = max < num ? num : max;
				sum += num;
			}

			System.out.println(min + " " + max + " " + sum);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
} Main public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str;
		String[] arrStr;
		try {
			// 1 line
			str = br.readLine();
			int[] arr = new int[Integer.parseInt(str)];

			// 2 line
			str = br.readLine();
			arrStr = str.split(" ");

			for(int i=0;i<arrStr.length;i++){
				arr[i] = Integer.parseInt(arrStr[i]);
			}

			int min = Integer.MAX_VALUE;
			int max = Integer.MIN_VALUE;
			long sum = 0;
			for(int num :arr){
				min = min > num ? num : min;
				max = max < num ? num : max;
				sum += num;
			}

			System.out.println(min + " " + max + " " + sum);
		} catch (IOException e) {
			e.printStackTrace();
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str;
		String[] arrStr;
		try {
			// 1 line
			str = br.readLine();
			int[] arr = new int[Integer.parseInt(str)];

			// 2 line
			str = br.readLine();
			arrStr = str.split(" ");

			for(int i=0;i<arrStr.length;i++){
				arr[i] = Integer.parseInt(arrStr[i]);
			}

			int min = Integer.MAX_VALUE;
			int max = Integer.MIN_VALUE;
			long sum = 0;
			for(int num :arr){
				min = min > num ? num : min;
				max = max < num ? num : max;
				sum += num;
			}

			System.out.println(min + " " + max + " " + sum);
		} catch (IOException e) {
			e.printStackTrace();
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String str; str String[] arrStr; arrStr try {
			// 1 line
			str = br.readLine();
			int[] arr = new int[Integer.parseInt(str)];

			// 2 line
			str = br.readLine();
			arrStr = str.split(" ");

			for(int i=0;i<arrStr.length;i++){
				arr[i] = Integer.parseInt(arrStr[i]);
			}

			int min = Integer.MAX_VALUE;
			int max = Integer.MIN_VALUE;
			long sum = 0;
			for(int num :arr){
				min = min > num ? num : min;
				max = max < num ? num : max;
				sum += num;
			}

			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 {
			// 1 line
			str = br.readLine();
			int[] arr = new int[Integer.parseInt(str)];

			// 2 line
			str = br.readLine();
			arrStr = str.split(" ");

			for(int i=0;i<arrStr.length;i++){
				arr[i] = Integer.parseInt(arrStr[i]);
			}

			int min = Integer.MAX_VALUE;
			int max = Integer.MIN_VALUE;
			long sum = 0;
			for(int num :arr){
				min = min > num ? num : min;
				max = max < num ? num : max;
				sum += num;
			}

			System.out.println(min + " " + max + " " + sum);
		} str = br.readLine() str br.readLine() br.readLine br int[] arr = new int[Integer.parseInt(str)]; arr new int[Integer.parseInt(str)] Integer.parseInt(str) Integer.parseInt Integer str str = br.readLine() str br.readLine() br.readLine br arrStr = str.split(" ") arrStr str.split(" ") str.split str " " for(int i=0;i<arrStr.length;i++){
				arr[i] = Integer.parseInt(arrStr[i]);
			} int i=0; int i=0; i 0 i<arrStr.length i arrStr.length arrStr arrStr.length i++ i++ i {
				arr[i] = Integer.parseInt(arrStr[i]);
			} {
				arr[i] = Integer.parseInt(arrStr[i]);
			} arr[i] = Integer.parseInt(arrStr[i]) arr[i] arr i Integer.parseInt(arrStr[i]) Integer.parseInt Integer arrStr[i] arrStr i int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE int max = Integer.MIN_VALUE; max Integer.MIN_VALUE Integer Integer.MIN_VALUE long sum = 0; sum 0 for(int num :arr){
				min = min > num ? num : min;
				max = max < num ? num : max;
				sum += num;
			} int num arr {
				min = min > num ? num : min;
				max = max < num ? num : max;
				sum += num;
			} {
				min = min > num ? num : min;
				max = max < num ? num : max;
				sum += num;
			} min = min > num ? num : min min min > num ? num : min min > num min num num min max = max < num ? num : max max max < num ? num : max max < num max num num max sum += num sum num 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) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str;
		String[] arrStr;
		try {
			// 1 line
			str = br.readLine();
			int[] arr = new int[Integer.parseInt(str)];

			// 2 line
			str = br.readLine();
			arrStr = str.split(" ");

			for(int i=0;i<arrStr.length;i++){
				arr[i] = Integer.parseInt(arrStr[i]);
			}

			int min = Integer.MAX_VALUE;
			int max = Integer.MIN_VALUE;
			long sum = 0;
			for(int num :arr){
				min = min > num ? num : min;
				max = max < num ? num : max;
				sum += num;
			}

			System.out.println(min + " " + max + " " + sum);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
} public class Main {

	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str;
		String[] arrStr;
		try {
			// 1 line
			str = br.readLine();
			int[] arr = new int[Integer.parseInt(str)];

			// 2 line
			str = br.readLine();
			arrStr = str.split(" ");

			for(int i=0;i<arrStr.length;i++){
				arr[i] = Integer.parseInt(arrStr[i]);
			}

			int min = Integer.MAX_VALUE;
			int max = Integer.MIN_VALUE;
			long sum = 0;
			for(int num :arr){
				min = min > num ? num : min;
				max = max < num ? num : max;
				sum += num;
			}

			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) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str;
		String[] arrStr;
		try {
			// 1 line
			str = br.readLine();
			int[] arr = new int[Integer.parseInt(str)];

			// 2 line
			str = br.readLine();
			arrStr = str.split(" ");

			for(int i=0;i<arrStr.length;i++){
				arr[i] = Integer.parseInt(arrStr[i]);
			}

			int min = Integer.MAX_VALUE;
			int max = Integer.MIN_VALUE;
			long sum = 0;
			for(int num :arr){
				min = min > num ? num : min;
				max = max < num ? num : max;
				sum += num;
			}

			System.out.println(min + " " + max + " " + sum);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}