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

class Main {
	public static void main(String[] args) {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		try {
			String n = br.readLine();
			String[] a = br.readLine().split(" ");
			int i, num, min = 1000000;
			int max = -1000000;
			BigInteger sum = BigInteger.ZERO;
			for (i = 0; i < a.length; i++) {
				num = Integer.parseInt(a[i]);
				if (num > max) {
					max = num;
				}
				if (num < min) {
					min = num;
				}
				sum = sum.add(BigInteger.valueOf(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 import java.math.BigInteger; BigInteger java.math class Main {
	public static void main(String[] args) {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		try {
			String n = br.readLine();
			String[] a = br.readLine().split(" ");
			int i, num, min = 1000000;
			int max = -1000000;
			BigInteger sum = BigInteger.ZERO;
			for (i = 0; i < a.length; i++) {
				num = Integer.parseInt(a[i]);
				if (num > max) {
					max = num;
				}
				if (num < min) {
					min = num;
				}
				sum = sum.add(BigInteger.valueOf(num));
			}
			System.out.println(min + " " + max + " " + sum);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
} Main public static void main(String[] args) {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		try {
			String n = br.readLine();
			String[] a = br.readLine().split(" ");
			int i, num, min = 1000000;
			int max = -1000000;
			BigInteger sum = BigInteger.ZERO;
			for (i = 0; i < a.length; i++) {
				num = Integer.parseInt(a[i]);
				if (num > max) {
					max = num;
				}
				if (num < min) {
					min = num;
				}
				sum = sum.add(BigInteger.valueOf(num));
			}
			System.out.println(min + " " + max + " " + sum);
		} catch (IOException e) {
			e.printStackTrace();
		}
	} main {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		try {
			String n = br.readLine();
			String[] a = br.readLine().split(" ");
			int i, num, min = 1000000;
			int max = -1000000;
			BigInteger sum = BigInteger.ZERO;
			for (i = 0; i < a.length; i++) {
				num = Integer.parseInt(a[i]);
				if (num > max) {
					max = num;
				}
				if (num < min) {
					min = num;
				}
				sum = sum.add(BigInteger.valueOf(num));
			}
			System.out.println(min + " " + max + " " + sum);
		} catch (IOException e) {
			e.printStackTrace();
		}
	} InputStreamReader isr = new InputStreamReader(System.in); isr new InputStreamReader(System.in) BufferedReader br = new BufferedReader(isr); br new BufferedReader(isr) try {
			String n = br.readLine();
			String[] a = br.readLine().split(" ");
			int i, num, min = 1000000;
			int max = -1000000;
			BigInteger sum = BigInteger.ZERO;
			for (i = 0; i < a.length; i++) {
				num = Integer.parseInt(a[i]);
				if (num > max) {
					max = num;
				}
				if (num < min) {
					min = num;
				}
				sum = sum.add(BigInteger.valueOf(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 {
			String n = br.readLine();
			String[] a = br.readLine().split(" ");
			int i, num, min = 1000000;
			int max = -1000000;
			BigInteger sum = BigInteger.ZERO;
			for (i = 0; i < a.length; i++) {
				num = Integer.parseInt(a[i]);
				if (num > max) {
					max = num;
				}
				if (num < min) {
					min = num;
				}
				sum = sum.add(BigInteger.valueOf(num));
			}
			System.out.println(min + " " + max + " " + sum);
		} String n = br.readLine(); n br.readLine() br.readLine br String[] a = br.readLine().split(" "); a br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int i i num num min = 1000000; min 1000000 int max = -1000000; max -1000000 1000000 BigInteger sum = BigInteger.ZERO; sum BigInteger.ZERO BigInteger BigInteger.ZERO for (i = 0; i < a.length; i++) {
				num = Integer.parseInt(a[i]);
				if (num > max) {
					max = num;
				}
				if (num < min) {
					min = num;
				}
				sum = sum.add(BigInteger.valueOf(num));
			} i = 0; i = 0 i 0 i < a.length i a.length a a.length i++ i++ i {
				num = Integer.parseInt(a[i]);
				if (num > max) {
					max = num;
				}
				if (num < min) {
					min = num;
				}
				sum = sum.add(BigInteger.valueOf(num));
			} {
				num = Integer.parseInt(a[i]);
				if (num > max) {
					max = num;
				}
				if (num < min) {
					min = num;
				}
				sum = sum.add(BigInteger.valueOf(num));
			} num = Integer.parseInt(a[i]) num Integer.parseInt(a[i]) Integer.parseInt Integer a[i] a i if (num > max) {
					max = num;
				} num > max num max {
					max = num;
				} max = num max num if (num < min) {
					min = num;
				} num < min num min {
					min = num;
				} min = num min num sum = sum.add(BigInteger.valueOf(num)) sum sum.add(BigInteger.valueOf(num)) sum.add sum BigInteger.valueOf(num) BigInteger.valueOf BigInteger 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
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;

class Main {
	public static void main(String[] args) {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		try {
			String n = br.readLine();
			String[] a = br.readLine().split(" ");
			int i, num, min = 1000000;
			int max = -1000000;
			BigInteger sum = BigInteger.ZERO;
			for (i = 0; i < a.length; i++) {
				num = Integer.parseInt(a[i]);
				if (num > max) {
					max = num;
				}
				if (num < min) {
					min = num;
				}
				sum = sum.add(BigInteger.valueOf(num));
			}
			System.out.println(min + " " + max + " " + sum);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}