import java.util.Scanner;

class Main{

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int[] a = new int[n];
		long sum=0;
		int max=-1000000,min=1000000;

		for(int i=0; i<n; i++)
		{
			a[i] = scan.nextInt();
			sum += a[i];

			max = Math.max(max, a[i]);
			min = Math.min(min, a[i]);
		}

		System.out.printf("%d %d %d\n", min, max, sum);

		scan.close();
	}
} import java.util.Scanner; Scanner java.util class Main{

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int[] a = new int[n];
		long sum=0;
		int max=-1000000,min=1000000;

		for(int i=0; i<n; i++)
		{
			a[i] = scan.nextInt();
			sum += a[i];

			max = Math.max(max, a[i]);
			min = Math.min(min, a[i]);
		}

		System.out.printf("%d %d %d\n", min, max, sum);

		scan.close();
	}
} Main public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int[] a = new int[n];
		long sum=0;
		int max=-1000000,min=1000000;

		for(int i=0; i<n; i++)
		{
			a[i] = scan.nextInt();
			sum += a[i];

			max = Math.max(max, a[i]);
			min = Math.min(min, a[i]);
		}

		System.out.printf("%d %d %d\n", min, max, sum);

		scan.close();
	} main {

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int[] a = new int[n];
		long sum=0;
		int max=-1000000,min=1000000;

		for(int i=0; i<n; i++)
		{
			a[i] = scan.nextInt();
			sum += a[i];

			max = Math.max(max, a[i]);
			min = Math.min(min, a[i]);
		}

		System.out.printf("%d %d %d\n", min, max, sum);

		scan.close();
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int[] a = new int[n]; a new int[n] n long sum=0; sum 0 int max=-1000000 max -1000000 1000000 min=1000000; min 1000000 for(int i=0; i<n; i++)
		{
			a[i] = scan.nextInt();
			sum += a[i];

			max = Math.max(max, a[i]);
			min = Math.min(min, a[i]);
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			a[i] = scan.nextInt();
			sum += a[i];

			max = Math.max(max, a[i]);
			min = Math.min(min, a[i]);
		} {
			a[i] = scan.nextInt();
			sum += a[i];

			max = Math.max(max, a[i]);
			min = Math.min(min, a[i]);
		} a[i] = scan.nextInt() a[i] a i scan.nextInt() scan.nextInt scan sum += a[i] sum a[i] 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 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 scan.close() scan.close scan String[] args args
import java.util.Scanner;

class Main{

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int[] a = new int[n];
		long sum=0;
		int max=-1000000,min=1000000;

		for(int i=0; i<n; i++)
		{
			a[i] = scan.nextInt();
			sum += a[i];

			max = Math.max(max, a[i]);
			min = Math.min(min, a[i]);
		}

		System.out.printf("%d %d %d\n", min, max, sum);

		scan.close();
	}
}