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());
		StringBuilder sb = new StringBuilder();

		String[] set = br.readLine().split(" ");
		long[] num = new long[N];

		for(int i = 0; i < N; i++){
			num[i] = Long.parseLong(set[i]);
		}

		long min = num[0];
		long max = num[0];
		long sum = num[0];
        for (int index = 1; index < N; index++) {
            min = Math.min(min, num[index]);
            max = Math.max(max, num[index]);
            sum += num[index];
        }
        System.out.print(sb.append(min).append(" ").append(max).append(" ").append(sum).append("\n"));
	}

} 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());
		StringBuilder sb = new StringBuilder();

		String[] set = br.readLine().split(" ");
		long[] num = new long[N];

		for(int i = 0; i < N; i++){
			num[i] = Long.parseLong(set[i]);
		}

		long min = num[0];
		long max = num[0];
		long sum = num[0];
        for (int index = 1; index < N; index++) {
            min = Math.min(min, num[index]);
            max = Math.max(max, num[index]);
            sum += num[index];
        }
        System.out.print(sb.append(min).append(" ").append(max).append(" ").append(sum).append("\n"));
	}

} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());
		StringBuilder sb = new StringBuilder();

		String[] set = br.readLine().split(" ");
		long[] num = new long[N];

		for(int i = 0; i < N; i++){
			num[i] = Long.parseLong(set[i]);
		}

		long min = num[0];
		long max = num[0];
		long sum = num[0];
        for (int index = 1; index < N; index++) {
            min = Math.min(min, num[index]);
            max = Math.max(max, num[index]);
            sum += num[index];
        }
        System.out.print(sb.append(min).append(" ").append(max).append(" ").append(sum).append("\n"));
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());
		StringBuilder sb = new StringBuilder();

		String[] set = br.readLine().split(" ");
		long[] num = new long[N];

		for(int i = 0; i < N; i++){
			num[i] = Long.parseLong(set[i]);
		}

		long min = num[0];
		long max = num[0];
		long sum = num[0];
        for (int index = 1; index < N; index++) {
            min = Math.min(min, num[index]);
            max = Math.max(max, num[index]);
            sum += num[index];
        }
        System.out.print(sb.append(min).append(" ").append(max).append(" ").append(sum).append("\n"));
	} 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 StringBuilder sb = new StringBuilder(); sb new StringBuilder() String[] set = br.readLine().split(" "); set br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " long[] num = new long[N]; num new long[N] N for(int i = 0; i < N; i++){
			num[i] = Long.parseLong(set[i]);
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			num[i] = Long.parseLong(set[i]);
		} {
			num[i] = Long.parseLong(set[i]);
		} num[i] = Long.parseLong(set[i]) num[i] num i Long.parseLong(set[i]) Long.parseLong Long set[i] set i long min = num[0]; min num[0] num 0 long max = num[0]; max num[0] num 0 long sum = num[0]; sum num[0] num 0 for (int index = 1; index < N; index++) {
            min = Math.min(min, num[index]);
            max = Math.max(max, num[index]);
            sum += num[index];
        } int index = 1; int index = 1; index 1 index < N index N index++ index++ index {
            min = Math.min(min, num[index]);
            max = Math.max(max, num[index]);
            sum += num[index];
        } {
            min = Math.min(min, num[index]);
            max = Math.max(max, num[index]);
            sum += num[index];
        } min = Math.min(min, num[index]) min Math.min(min, num[index]) Math.min Math min num[index] num index max = Math.max(max, num[index]) max Math.max(max, num[index]) Math.max Math max num[index] num index sum += num[index] sum num[index] num index System.out.print(sb.append(min).append(" ").append(max).append(" ").append(sum).append("\n")) System.out.print System.out System System.out sb.append(min).append(" ").append(max).append(" ").append(sum).append("\n") sb.append(min).append(" ").append(max).append(" ").append(sum).append sb.append(min).append(" ").append(max).append(" ").append(sum) sb.append(min).append(" ").append(max).append(" ").append sb.append(min).append(" ").append(max).append(" ") sb.append(min).append(" ").append(max).append sb.append(min).append(" ").append(max) sb.append(min).append(" ").append sb.append(min).append(" ") sb.append(min).append sb.append(min) sb.append sb min " " max " " sum "\n" 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());
		StringBuilder sb = new StringBuilder();

		String[] set = br.readLine().split(" ");
		long[] num = new long[N];

		for(int i = 0; i < N; i++){
			num[i] = Long.parseLong(set[i]);
		}

		long min = num[0];
		long max = num[0];
		long sum = num[0];
        for (int index = 1; index < N; index++) {
            min = Math.min(min, num[index]);
            max = Math.max(max, num[index]);
            sum += num[index];
        }
        System.out.print(sb.append(min).append(" ").append(max).append(" ").append(sum).append("\n"));
	}

} 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());
		StringBuilder sb = new StringBuilder();

		String[] set = br.readLine().split(" ");
		long[] num = new long[N];

		for(int i = 0; i < N; i++){
			num[i] = Long.parseLong(set[i]);
		}

		long min = num[0];
		long max = num[0];
		long sum = num[0];
        for (int index = 1; index < N; index++) {
            min = Math.min(min, num[index]);
            max = Math.max(max, num[index]);
            sum += num[index];
        }
        System.out.print(sb.append(min).append(" ").append(max).append(" ").append(sum).append("\n"));
	}

} 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());
		StringBuilder sb = new StringBuilder();

		String[] set = br.readLine().split(" ");
		long[] num = new long[N];

		for(int i = 0; i < N; i++){
			num[i] = Long.parseLong(set[i]);
		}

		long min = num[0];
		long max = num[0];
		long sum = num[0];
        for (int index = 1; index < N; index++) {
            min = Math.min(min, num[index]);
            max = Math.max(max, num[index]);
            sum += num[index];
        }
        System.out.print(sb.append(min).append(" ").append(max).append(" ").append(sum).append("\n"));
	}

}