import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;

class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		Integer num = Integer.parseInt(br.readLine());
		String[] inNumArrays = br.readLine().split(" ");
		long sum = 0;
		ArrayList<Integer> numArrayList = new ArrayList<Integer>();
		for (int i = 0; i < num; i++) {
			numArrayList.add(Integer.parseInt(inNumArrays[i]));
			sum += Integer.parseInt(inNumArrays[i]);
		}
		Collections.sort(numArrayList);
		System.out.println(numArrayList.get(0) + " " + numArrayList.get(numArrayList.size()-1) + " " + sum);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		Integer num = Integer.parseInt(br.readLine());
		String[] inNumArrays = br.readLine().split(" ");
		long sum = 0;
		ArrayList<Integer> numArrayList = new ArrayList<Integer>();
		for (int i = 0; i < num; i++) {
			numArrayList.add(Integer.parseInt(inNumArrays[i]));
			sum += Integer.parseInt(inNumArrays[i]);
		}
		Collections.sort(numArrayList);
		System.out.println(numArrayList.get(0) + " " + numArrayList.get(numArrayList.size()-1) + " " + sum);
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		Integer num = Integer.parseInt(br.readLine());
		String[] inNumArrays = br.readLine().split(" ");
		long sum = 0;
		ArrayList<Integer> numArrayList = new ArrayList<Integer>();
		for (int i = 0; i < num; i++) {
			numArrayList.add(Integer.parseInt(inNumArrays[i]));
			sum += Integer.parseInt(inNumArrays[i]);
		}
		Collections.sort(numArrayList);
		System.out.println(numArrayList.get(0) + " " + numArrayList.get(numArrayList.size()-1) + " " + sum);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		Integer num = Integer.parseInt(br.readLine());
		String[] inNumArrays = br.readLine().split(" ");
		long sum = 0;
		ArrayList<Integer> numArrayList = new ArrayList<Integer>();
		for (int i = 0; i < num; i++) {
			numArrayList.add(Integer.parseInt(inNumArrays[i]));
			sum += Integer.parseInt(inNumArrays[i]);
		}
		Collections.sort(numArrayList);
		System.out.println(numArrayList.get(0) + " " + numArrayList.get(numArrayList.size()-1) + " " + sum);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) Integer num = Integer.parseInt(br.readLine()); num Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String[] inNumArrays = br.readLine().split(" "); inNumArrays br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " long sum = 0; sum 0 ArrayList<Integer> numArrayList = new ArrayList<Integer>(); numArrayList new ArrayList<Integer>() for (int i = 0; i < num; i++) {
			numArrayList.add(Integer.parseInt(inNumArrays[i]));
			sum += Integer.parseInt(inNumArrays[i]);
		} int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
			numArrayList.add(Integer.parseInt(inNumArrays[i]));
			sum += Integer.parseInt(inNumArrays[i]);
		} {
			numArrayList.add(Integer.parseInt(inNumArrays[i]));
			sum += Integer.parseInt(inNumArrays[i]);
		} numArrayList.add(Integer.parseInt(inNumArrays[i])) numArrayList.add numArrayList Integer.parseInt(inNumArrays[i]) Integer.parseInt Integer inNumArrays[i] inNumArrays i sum += Integer.parseInt(inNumArrays[i]) sum Integer.parseInt(inNumArrays[i]) Integer.parseInt Integer inNumArrays[i] inNumArrays i Collections.sort(numArrayList) Collections.sort Collections numArrayList System.out.println(numArrayList.get(0) + " " + numArrayList.get(numArrayList.size()-1) + " " + sum) System.out.println System.out System System.out numArrayList.get(0) + " " + numArrayList.get(numArrayList.size()-1) + " " + sum " " numArrayList.get(numArrayList.size()-1) numArrayList.get(0) + " " + numArrayList.get(numArrayList.size()-1) + " " + sum numArrayList.get(0) numArrayList.get numArrayList 0 " " numArrayList.get(numArrayList.size()-1) numArrayList.get numArrayList numArrayList.size()-1 numArrayList.size() numArrayList.size numArrayList 1 " " sum String[] args args
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;

class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		Integer num = Integer.parseInt(br.readLine());
		String[] inNumArrays = br.readLine().split(" ");
		long sum = 0;
		ArrayList<Integer> numArrayList = new ArrayList<Integer>();
		for (int i = 0; i < num; i++) {
			numArrayList.add(Integer.parseInt(inNumArrays[i]));
			sum += Integer.parseInt(inNumArrays[i]);
		}
		Collections.sort(numArrayList);
		System.out.println(numArrayList.get(0) + " " + numArrayList.get(numArrayList.size()-1) + " " + sum);
	}
}