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

public class Main {

	public static void main(String[] args) {

        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		try {
			int num = Integer.parseInt(reader.readLine());
			String[] numData = reader.readLine().split(" ");
			outputMinMaxTotal(numData);

		} catch (IOException e) {
			e.printStackTrace();
		}

	}

	private static void outputMinMaxTotal(String[] numData) {

		int min = 1000000;
		int max = -1000000;
		long total = 0;
		for(int i=0;i<numData.length;i++){
			int target = Integer.parseInt(numData[i]);
			if(min > target){
				min = target;
			}
			if(max < target){
				max = target;
			}
			total = total + target;
		}
		System.out.println(min + " " + max + " " + total);

	}

} 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 reader = new BufferedReader(new InputStreamReader(System.in));
		try {
			int num = Integer.parseInt(reader.readLine());
			String[] numData = reader.readLine().split(" ");
			outputMinMaxTotal(numData);

		} catch (IOException e) {
			e.printStackTrace();
		}

	}

	private static void outputMinMaxTotal(String[] numData) {

		int min = 1000000;
		int max = -1000000;
		long total = 0;
		for(int i=0;i<numData.length;i++){
			int target = Integer.parseInt(numData[i]);
			if(min > target){
				min = target;
			}
			if(max < target){
				max = target;
			}
			total = total + target;
		}
		System.out.println(min + " " + max + " " + total);

	}

} Main public static void main(String[] args) {

        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		try {
			int num = Integer.parseInt(reader.readLine());
			String[] numData = reader.readLine().split(" ");
			outputMinMaxTotal(numData);

		} catch (IOException e) {
			e.printStackTrace();
		}

	} main {

        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		try {
			int num = Integer.parseInt(reader.readLine());
			String[] numData = reader.readLine().split(" ");
			outputMinMaxTotal(numData);

		} catch (IOException e) {
			e.printStackTrace();
		}

	} BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) try {
			int num = Integer.parseInt(reader.readLine());
			String[] numData = reader.readLine().split(" ");
			outputMinMaxTotal(numData);

		} catch (IOException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} IOException e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			int num = Integer.parseInt(reader.readLine());
			String[] numData = reader.readLine().split(" ");
			outputMinMaxTotal(numData);

		} int num = Integer.parseInt(reader.readLine()); num Integer.parseInt(reader.readLine()) Integer.parseInt Integer reader.readLine() reader.readLine reader String[] numData = reader.readLine().split(" "); numData reader.readLine().split(" ") reader.readLine().split reader.readLine() reader.readLine reader " " outputMinMaxTotal(numData) outputMinMaxTotal numData String[] args args private static void outputMinMaxTotal(String[] numData) {

		int min = 1000000;
		int max = -1000000;
		long total = 0;
		for(int i=0;i<numData.length;i++){
			int target = Integer.parseInt(numData[i]);
			if(min > target){
				min = target;
			}
			if(max < target){
				max = target;
			}
			total = total + target;
		}
		System.out.println(min + " " + max + " " + total);

	} outputMinMaxTotal {

		int min = 1000000;
		int max = -1000000;
		long total = 0;
		for(int i=0;i<numData.length;i++){
			int target = Integer.parseInt(numData[i]);
			if(min > target){
				min = target;
			}
			if(max < target){
				max = target;
			}
			total = total + target;
		}
		System.out.println(min + " " + max + " " + total);

	} int min = 1000000; min 1000000 int max = -1000000; max -1000000 1000000 long total = 0; total 0 for(int i=0;i<numData.length;i++){
			int target = Integer.parseInt(numData[i]);
			if(min > target){
				min = target;
			}
			if(max < target){
				max = target;
			}
			total = total + target;
		} int i=0; int i=0; i 0 i<numData.length i numData.length numData numData.length i++ i++ i {
			int target = Integer.parseInt(numData[i]);
			if(min > target){
				min = target;
			}
			if(max < target){
				max = target;
			}
			total = total + target;
		} {
			int target = Integer.parseInt(numData[i]);
			if(min > target){
				min = target;
			}
			if(max < target){
				max = target;
			}
			total = total + target;
		} int target = Integer.parseInt(numData[i]); target Integer.parseInt(numData[i]) Integer.parseInt Integer numData[i] numData i if(min > target){
				min = target;
			} min > target min target {
				min = target;
			} min = target min target if(max < target){
				max = target;
			} max < target max target {
				max = target;
			} max = target max target total = total + target total total + target total target System.out.println(min + " " + max + " " + total) System.out.println System.out System System.out min + " " + max + " " + total " " max min + " " + max + " " + total min " " max " " total String[] numData numData public class Main {

	public static void main(String[] args) {

        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		try {
			int num = Integer.parseInt(reader.readLine());
			String[] numData = reader.readLine().split(" ");
			outputMinMaxTotal(numData);

		} catch (IOException e) {
			e.printStackTrace();
		}

	}

	private static void outputMinMaxTotal(String[] numData) {

		int min = 1000000;
		int max = -1000000;
		long total = 0;
		for(int i=0;i<numData.length;i++){
			int target = Integer.parseInt(numData[i]);
			if(min > target){
				min = target;
			}
			if(max < target){
				max = target;
			}
			total = total + target;
		}
		System.out.println(min + " " + max + " " + total);

	}

} public class Main {

	public static void main(String[] args) {

        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		try {
			int num = Integer.parseInt(reader.readLine());
			String[] numData = reader.readLine().split(" ");
			outputMinMaxTotal(numData);

		} catch (IOException e) {
			e.printStackTrace();
		}

	}

	private static void outputMinMaxTotal(String[] numData) {

		int min = 1000000;
		int max = -1000000;
		long total = 0;
		for(int i=0;i<numData.length;i++){
			int target = Integer.parseInt(numData[i]);
			if(min > target){
				min = target;
			}
			if(max < target){
				max = target;
			}
			total = total + target;
		}
		System.out.println(min + " " + max + " " + total);

	}

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

public class Main {

	public static void main(String[] args) {

        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		try {
			int num = Integer.parseInt(reader.readLine());
			String[] numData = reader.readLine().split(" ");
			outputMinMaxTotal(numData);

		} catch (IOException e) {
			e.printStackTrace();
		}

	}

	private static void outputMinMaxTotal(String[] numData) {

		int min = 1000000;
		int max = -1000000;
		long total = 0;
		for(int i=0;i<numData.length;i++){
			int target = Integer.parseInt(numData[i]);
			if(min > target){
				min = target;
			}
			if(max < target){
				max = target;
			}
			total = total + target;
		}
		System.out.println(min + " " + max + " " + total);

	}

}