import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);

		final long n = sc.nextLong();
		
		long min = Integer.MAX_VALUE;
		long max = Integer.MIN_VALUE;
		long sum = 0;
		for(int i = 0; i < n; i++){
			final int input = sc.nextInt();
			
			min = Math.min(min, input);
			max = Math.max(max, input);
			sum += input;
		}
		
		System.out.println(min + " " + max + " " + sum);
	}

} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);

		final long n = sc.nextLong();
		
		long min = Integer.MAX_VALUE;
		long max = Integer.MIN_VALUE;
		long sum = 0;
		for(int i = 0; i < n; i++){
			final int input = sc.nextInt();
			
			min = Math.min(min, input);
			max = Math.max(max, input);
			sum += input;
		}
		
		System.out.println(min + " " + max + " " + sum);
	}

} Main public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);

		final long n = sc.nextLong();
		
		long min = Integer.MAX_VALUE;
		long max = Integer.MIN_VALUE;
		long sum = 0;
		for(int i = 0; i < n; i++){
			final int input = sc.nextInt();
			
			min = Math.min(min, input);
			max = Math.max(max, input);
			sum += input;
		}
		
		System.out.println(min + " " + max + " " + sum);
	} main {
		Scanner sc = new Scanner(System.in);

		final long n = sc.nextLong();
		
		long min = Integer.MAX_VALUE;
		long max = Integer.MIN_VALUE;
		long sum = 0;
		for(int i = 0; i < n; i++){
			final int input = sc.nextInt();
			
			min = Math.min(min, input);
			max = Math.max(max, input);
			sum += input;
		}
		
		System.out.println(min + " " + max + " " + sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final long n = sc.nextLong(); n sc.nextLong() sc.nextLong sc long min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE long max = Integer.MIN_VALUE; max Integer.MIN_VALUE Integer Integer.MIN_VALUE long sum = 0; sum 0 for(int i = 0; i < n; i++){
			final int input = sc.nextInt();
			
			min = Math.min(min, input);
			max = Math.max(max, input);
			sum += input;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			final int input = sc.nextInt();
			
			min = Math.min(min, input);
			max = Math.max(max, input);
			sum += input;
		} {
			final int input = sc.nextInt();
			
			min = Math.min(min, input);
			max = Math.max(max, input);
			sum += input;
		} final int input = sc.nextInt(); input sc.nextInt() sc.nextInt sc min = Math.min(min, input) min Math.min(min, input) Math.min Math min input max = Math.max(max, input) max Math.max(max, input) Math.max Math max input sum += input sum input 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[]) {
		Scanner sc = new Scanner(System.in);

		final long n = sc.nextLong();
		
		long min = Integer.MAX_VALUE;
		long max = Integer.MIN_VALUE;
		long sum = 0;
		for(int i = 0; i < n; i++){
			final int input = sc.nextInt();
			
			min = Math.min(min, input);
			max = Math.max(max, input);
			sum += input;
		}
		
		System.out.println(min + " " + max + " " + sum);
	}

} public class Main {

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);

		final long n = sc.nextLong();
		
		long min = Integer.MAX_VALUE;
		long max = Integer.MIN_VALUE;
		long sum = 0;
		for(int i = 0; i < n; i++){
			final int input = sc.nextInt();
			
			min = Math.min(min, input);
			max = Math.max(max, input);
			sum += input;
		}
		
		System.out.println(min + " " + max + " " + sum);
	}

} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);

		final long n = sc.nextLong();
		
		long min = Integer.MAX_VALUE;
		long max = Integer.MIN_VALUE;
		long sum = 0;
		for(int i = 0; i < n; i++){
			final int input = sc.nextInt();
			
			min = Math.min(min, input);
			max = Math.max(max, input);
			sum += input;
		}
		
		System.out.println(min + " " + max + " " + sum);
	}

}