import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigDecimal;

public class Main {
	public static void main(String[] args) throws Exception {
		int eNum;//????????????????´???°????´???¨

		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);

		String str = br.readLine();//????????????????´???°???????´?
		eNum = Integer.parseInt(str);

		String[] element = new String[eNum];

		str = br.readLine();
		element = getElement(str);//????????????????´????????´?

		System.out.println(getMin(element, eNum) + " " +
				getMax(element, eNum) + " " + getSum(element, eNum));
	}

	//?????§???????±???????????????????
	public static int getMax(String[] element, int num) {
		int max = Integer.parseInt(element[0]);
		for (int i = 0; i < num; i++) {
			max = Math.max(max, Integer.parseInt(element[i]));
		}
		return (max);
	}

	//????°????????±???????????????????
	public static int getMin(String[] element, int num) {
		int min = Integer.parseInt(element[0]);
		for (int i = 0; i < num; i++) {
			min = Math.min(min, Integer.parseInt(element[i]));
		}
		return (min);
	}

	//????¨?????±???????????????????
	public static BigDecimal getSum(String[] element, int num) {
		BigDecimal sum = new BigDecimal("0");

		for (int i = 0; i < num; i++) {
			sum = sum.add(new BigDecimal(element[i]));
//			System.out.println("i="+i+" "+element[i]);
		}
		return (sum);
	}

	//??????????????????????????????????????????
	public static String[] getElement(String element) {
		return (element.split(" "));
	}

}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz