import java.io.*;

public class Main{
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line1 = br.readLine();
		int n = Integer.parseInt(line1);
		int[] a = new int[n];
		String line2 = br.readLine();
		String[] str = line2.split(" ");
		for (int i = 0; i < n ; i++){
			a[i] = Integer.parseInt(str[i]);
		}
		int max = a[0];
		int min = a[0];
		long sum = (long) a[0];
		for (int i = 1; i < n ; i++){
			max = Math.max(max,a[i]);
			min = Math.min(min,a[i]);
			sum += (long) a[i];
		}
		System.out.println(min + " " + max +" "+ sum);
	}
} import java.io.*; io.* java public class Main{
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line1 = br.readLine();
		int n = Integer.parseInt(line1);
		int[] a = new int[n];
		String line2 = br.readLine();
		String[] str = line2.split(" ");
		for (int i = 0; i < n ; i++){
			a[i] = Integer.parseInt(str[i]);
		}
		int max = a[0];
		int min = a[0];
		long sum = (long) a[0];
		for (int i = 1; i < n ; i++){
			max = Math.max(max,a[i]);
			min = Math.min(min,a[i]);
			sum += (long) 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));
		String line1 = br.readLine();
		int n = Integer.parseInt(line1);
		int[] a = new int[n];
		String line2 = br.readLine();
		String[] str = line2.split(" ");
		for (int i = 0; i < n ; i++){
			a[i] = Integer.parseInt(str[i]);
		}
		int max = a[0];
		int min = a[0];
		long sum = (long) a[0];
		for (int i = 1; i < n ; i++){
			max = Math.max(max,a[i]);
			min = Math.min(min,a[i]);
			sum += (long) a[i];
		}
		System.out.println(min + " " + max +" "+ sum);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line1 = br.readLine();
		int n = Integer.parseInt(line1);
		int[] a = new int[n];
		String line2 = br.readLine();
		String[] str = line2.split(" ");
		for (int i = 0; i < n ; i++){
			a[i] = Integer.parseInt(str[i]);
		}
		int max = a[0];
		int min = a[0];
		long sum = (long) a[0];
		for (int i = 1; i < n ; i++){
			max = Math.max(max,a[i]);
			min = Math.min(min,a[i]);
			sum += (long) a[i];
		}
		System.out.println(min + " " + max +" "+ sum);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String line1 = br.readLine(); line1 br.readLine() br.readLine br int n = Integer.parseInt(line1); n Integer.parseInt(line1) Integer.parseInt Integer line1 int[] a = new int[n]; a new int[n] n String line2 = br.readLine(); line2 br.readLine() br.readLine br String[] str = line2.split(" "); str line2.split(" ") line2.split line2 " " for (int i = 0; i < n ; i++){
			a[i] = Integer.parseInt(str[i]);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			a[i] = Integer.parseInt(str[i]);
		} {
			a[i] = Integer.parseInt(str[i]);
		} a[i] = Integer.parseInt(str[i]) a[i] a i Integer.parseInt(str[i]) Integer.parseInt Integer str[i] str i int max = a[0]; max a[0] a 0 int min = a[0]; min a[0] a 0 long sum = (long) a[0]; sum (long) a[0] a 0 for (int i = 1; i < n ; i++){
			max = Math.max(max,a[i]);
			min = Math.min(min,a[i]);
			sum += (long) a[i];
		} int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
			max = Math.max(max,a[i]);
			min = Math.min(min,a[i]);
			sum += (long) a[i];
		} {
			max = Math.max(max,a[i]);
			min = Math.min(min,a[i]);
			sum += (long) a[i];
		} max = Math.max(max,a[i]) max Math.max(max,a[i]) Math.max Math max a[i] a i min = Math.min(min,a[i]) min Math.min(min,a[i]) Math.min Math min a[i] a i sum += (long) a[i] sum (long) 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 public class Main{
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line1 = br.readLine();
		int n = Integer.parseInt(line1);
		int[] a = new int[n];
		String line2 = br.readLine();
		String[] str = line2.split(" ");
		for (int i = 0; i < n ; i++){
			a[i] = Integer.parseInt(str[i]);
		}
		int max = a[0];
		int min = a[0];
		long sum = (long) a[0];
		for (int i = 1; i < n ; i++){
			max = Math.max(max,a[i]);
			min = Math.min(min,a[i]);
			sum += (long) a[i];
		}
		System.out.println(min + " " + max +" "+ sum);
	}
} public class Main{
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line1 = br.readLine();
		int n = Integer.parseInt(line1);
		int[] a = new int[n];
		String line2 = br.readLine();
		String[] str = line2.split(" ");
		for (int i = 0; i < n ; i++){
			a[i] = Integer.parseInt(str[i]);
		}
		int max = a[0];
		int min = a[0];
		long sum = (long) a[0];
		for (int i = 1; i < n ; i++){
			max = Math.max(max,a[i]);
			min = Math.min(min,a[i]);
			sum += (long) a[i];
		}
		System.out.println(min + " " + max +" "+ sum);
	}
} Main
import java.io.*;

public class Main{
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line1 = br.readLine();
		int n = Integer.parseInt(line1);
		int[] a = new int[n];
		String line2 = br.readLine();
		String[] str = line2.split(" ");
		for (int i = 0; i < n ; i++){
			a[i] = Integer.parseInt(str[i]);
		}
		int max = a[0];
		int min = a[0];
		long sum = (long) a[0];
		for (int i = 1; i < n ; i++){
			max = Math.max(max,a[i]);
			min = Math.min(min,a[i]);
			sum += (long) a[i];
		}
		System.out.println(min + " " + max +" "+ sum);
	}
}