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

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String[] tmp = br.readLine().split(" ");
		long[] input = new long[n];
		for (int i = 0; i < n; i++) {
			input[i] = Long.parseLong(tmp[i]);
		}
		long max = input[0];
		long min = input[0];
		long sum = 0;
		for(long x : input){
			max = Math.max(max, x);
			min = Math.min(min, x);
			sum += x;
		}
		System.out.printf("%d %d %d%n", min, max, sum);
	}

} 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) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String[] tmp = br.readLine().split(" ");
		long[] input = new long[n];
		for (int i = 0; i < n; i++) {
			input[i] = Long.parseLong(tmp[i]);
		}
		long max = input[0];
		long min = input[0];
		long sum = 0;
		for(long x : input){
			max = Math.max(max, x);
			min = Math.min(min, x);
			sum += x;
		}
		System.out.printf("%d %d %d%n", min, max, sum);
	}

} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String[] tmp = br.readLine().split(" ");
		long[] input = new long[n];
		for (int i = 0; i < n; i++) {
			input[i] = Long.parseLong(tmp[i]);
		}
		long max = input[0];
		long min = input[0];
		long sum = 0;
		for(long x : input){
			max = Math.max(max, x);
			min = Math.min(min, x);
			sum += x;
		}
		System.out.printf("%d %d %d%n", min, max, sum);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String[] tmp = br.readLine().split(" ");
		long[] input = new long[n];
		for (int i = 0; i < n; i++) {
			input[i] = Long.parseLong(tmp[i]);
		}
		long max = input[0];
		long min = input[0];
		long sum = 0;
		for(long x : input){
			max = Math.max(max, x);
			min = Math.min(min, x);
			sum += x;
		}
		System.out.printf("%d %d %d%n", min, max, sum);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String[] tmp = br.readLine().split(" "); tmp br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " long[] input = new long[n]; input new long[n] n for (int i = 0; i < n; i++) {
			input[i] = Long.parseLong(tmp[i]);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			input[i] = Long.parseLong(tmp[i]);
		} {
			input[i] = Long.parseLong(tmp[i]);
		} input[i] = Long.parseLong(tmp[i]) input[i] input i Long.parseLong(tmp[i]) Long.parseLong Long tmp[i] tmp i long max = input[0]; max input[0] input 0 long min = input[0]; min input[0] input 0 long sum = 0; sum 0 for(long x : input){
			max = Math.max(max, x);
			min = Math.min(min, x);
			sum += x;
		} long x input {
			max = Math.max(max, x);
			min = Math.min(min, x);
			sum += x;
		} {
			max = Math.max(max, x);
			min = Math.min(min, x);
			sum += x;
		} max = Math.max(max, x) max Math.max(max, x) Math.max Math max x min = Math.min(min, x) min Math.min(min, x) Math.min Math min x sum += x sum x System.out.printf("%d %d %d%n", min, max, sum) System.out.printf System.out System System.out "%d %d %d%n" min max sum String[] args args public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String[] tmp = br.readLine().split(" ");
		long[] input = new long[n];
		for (int i = 0; i < n; i++) {
			input[i] = Long.parseLong(tmp[i]);
		}
		long max = input[0];
		long min = input[0];
		long sum = 0;
		for(long x : input){
			max = Math.max(max, x);
			min = Math.min(min, x);
			sum += x;
		}
		System.out.printf("%d %d %d%n", min, max, sum);
	}

} public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String[] tmp = br.readLine().split(" ");
		long[] input = new long[n];
		for (int i = 0; i < n; i++) {
			input[i] = Long.parseLong(tmp[i]);
		}
		long max = input[0];
		long min = input[0];
		long sum = 0;
		for(long x : input){
			max = Math.max(max, x);
			min = Math.min(min, x);
			sum += x;
		}
		System.out.printf("%d %d %d%n", min, max, sum);
	}

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

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String[] tmp = br.readLine().split(" ");
		long[] input = new long[n];
		for (int i = 0; i < n; i++) {
			input[i] = Long.parseLong(tmp[i]);
		}
		long max = input[0];
		long min = input[0];
		long sum = 0;
		for(long x : input){
			max = Math.max(max, x);
			min = Math.min(min, x);
			sum += x;
		}
		System.out.printf("%d %d %d%n", min, max, sum);
	}

}