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

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 input = br.readLine();
		StringTokenizer st = new StringTokenizer(input, " ");
		long[] a = new long[n];
		long min = 1000000;
		long max = -1000000;
		long sum = 0;

		for(int i = 0; i < n; i++){
			a[i] = Long.parseLong(st.nextToken());
			min = Math.min(min, a[i]);
			max = Math.max(max, a[i]);
			sum += a[i];
		}

		System.out.println(min + " " + max + " " + sum);

	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io import java.util.StringTokenizer; StringTokenizer java.util 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 input = br.readLine();
		StringTokenizer st = new StringTokenizer(input, " ");
		long[] a = new long[n];
		long min = 1000000;
		long max = -1000000;
		long sum = 0;

		for(int i = 0; i < n; i++){
			a[i] = Long.parseLong(st.nextToken());
			min = Math.min(min, a[i]);
			max = Math.max(max, a[i]);
			sum += a[i];
		}

		System.out.println(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 input = br.readLine();
		StringTokenizer st = new StringTokenizer(input, " ");
		long[] a = new long[n];
		long min = 1000000;
		long max = -1000000;
		long sum = 0;

		for(int i = 0; i < n; i++){
			a[i] = Long.parseLong(st.nextToken());
			min = Math.min(min, a[i]);
			max = Math.max(max, a[i]);
			sum += a[i];
		}

		System.out.println(min + " " + max + " " + sum);

	} main {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String input = br.readLine();
		StringTokenizer st = new StringTokenizer(input, " ");
		long[] a = new long[n];
		long min = 1000000;
		long max = -1000000;
		long sum = 0;

		for(int i = 0; i < n; i++){
			a[i] = Long.parseLong(st.nextToken());
			min = Math.min(min, a[i]);
			max = Math.max(max, a[i]);
			sum += a[i];
		}

		System.out.println(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 input = br.readLine(); input br.readLine() br.readLine br StringTokenizer st = new StringTokenizer(input, " "); st new StringTokenizer(input, " ") long[] a = new long[n]; a new long[n] n long min = 1000000; min 1000000 long max = -1000000; max -1000000 1000000 long sum = 0; sum 0 for(int i = 0; i < n; i++){
			a[i] = Long.parseLong(st.nextToken());
			min = Math.min(min, a[i]);
			max = Math.max(max, a[i]);
			sum += a[i];
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			a[i] = Long.parseLong(st.nextToken());
			min = Math.min(min, a[i]);
			max = Math.max(max, a[i]);
			sum += a[i];
		} {
			a[i] = Long.parseLong(st.nextToken());
			min = Math.min(min, a[i]);
			max = Math.max(max, a[i]);
			sum += a[i];
		} a[i] = Long.parseLong(st.nextToken()) a[i] a i Long.parseLong(st.nextToken()) Long.parseLong Long st.nextToken() st.nextToken st min = Math.min(min, a[i]) min Math.min(min, a[i]) Math.min Math min a[i] a i max = Math.max(max, a[i]) max Math.max(max, a[i]) Math.max Math max a[i] a i sum += a[i] sum a[i] a i System.out.println(min + " " + max + " " + sum) System.out.println System.out System System.out min + " " + max + " " + sum " " max min + " " + max + " " + sum min " " max " " sum String[] args args
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.StringTokenizer;

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 input = br.readLine();
		StringTokenizer st = new StringTokenizer(input, " ");
		long[] a = new long[n];
		long min = 1000000;
		long max = -1000000;
		long sum = 0;

		for(int i = 0; i < n; i++){
			a[i] = Long.parseLong(st.nextToken());
			min = Math.min(min, a[i]);
			max = Math.max(max, a[i]);
			sum += a[i];
		}

		System.out.println(min + " " + max + " " + sum);

	}
}