import java.util.Scanner;

public class Main {
	public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		int count = scan.nextInt();
		int min = 1000000;
		int max = -1000000;
		long sum = 0;
		int num = 0;
		for(int i = 0;i < count;i++)
		{
			num = scan.nextInt();
			sum = sum + num;
			if(num < min)
			{
				min = num;
			}
			if(num > max)
			{
				max = num;
			}
		}
		System.out.println(min + " " + max + " " + sum);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		int count = scan.nextInt();
		int min = 1000000;
		int max = -1000000;
		long sum = 0;
		int num = 0;
		for(int i = 0;i < count;i++)
		{
			num = scan.nextInt();
			sum = sum + num;
			if(num < min)
			{
				min = num;
			}
			if(num > max)
			{
				max = num;
			}
		}
		System.out.println(min + " " + max + " " + sum);
	}
} Main public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		int count = scan.nextInt();
		int min = 1000000;
		int max = -1000000;
		long sum = 0;
		int num = 0;
		for(int i = 0;i < count;i++)
		{
			num = scan.nextInt();
			sum = sum + num;
			if(num < min)
			{
				min = num;
			}
			if(num > max)
			{
				max = num;
			}
		}
		System.out.println(min + " " + max + " " + sum);
	} main {
		Scanner scan = new Scanner(System.in);
		int count = scan.nextInt();
		int min = 1000000;
		int max = -1000000;
		long sum = 0;
		int num = 0;
		for(int i = 0;i < count;i++)
		{
			num = scan.nextInt();
			sum = sum + num;
			if(num < min)
			{
				min = num;
			}
			if(num > max)
			{
				max = num;
			}
		}
		System.out.println(min + " " + max + " " + sum);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int count = scan.nextInt(); count scan.nextInt() scan.nextInt scan int min = 1000000; min 1000000 int max = -1000000; max -1000000 1000000 long sum = 0; sum 0 int num = 0; num 0 for(int i = 0;i < count;i++)
		{
			num = scan.nextInt();
			sum = sum + num;
			if(num < min)
			{
				min = num;
			}
			if(num > max)
			{
				max = num;
			}
		} int i = 0; int i = 0; i 0 i < count i count i++ i++ i {
			num = scan.nextInt();
			sum = sum + num;
			if(num < min)
			{
				min = num;
			}
			if(num > max)
			{
				max = num;
			}
		} {
			num = scan.nextInt();
			sum = sum + num;
			if(num < min)
			{
				min = num;
			}
			if(num > max)
			{
				max = num;
			}
		} num = scan.nextInt() num scan.nextInt() scan.nextInt scan sum = sum + num sum sum + num sum num if(num < min)
			{
				min = num;
			} num < min num min {
				min = num;
			} min = num min num if(num > max)
			{
				max = num;
			} num > max num max {
				max = num;
			} max = num max num 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 scan = new Scanner(System.in);
		int count = scan.nextInt();
		int min = 1000000;
		int max = -1000000;
		long sum = 0;
		int num = 0;
		for(int i = 0;i < count;i++)
		{
			num = scan.nextInt();
			sum = sum + num;
			if(num < min)
			{
				min = num;
			}
			if(num > max)
			{
				max = num;
			}
		}
		System.out.println(min + " " + max + " " + sum);
	}
} public class Main {
	public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		int count = scan.nextInt();
		int min = 1000000;
		int max = -1000000;
		long sum = 0;
		int num = 0;
		for(int i = 0;i < count;i++)
		{
			num = scan.nextInt();
			sum = sum + num;
			if(num < min)
			{
				min = num;
			}
			if(num > max)
			{
				max = num;
			}
		}
		System.out.println(min + " " + max + " " + sum);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		int count = scan.nextInt();
		int min = 1000000;
		int max = -1000000;
		long sum = 0;
		int num = 0;
		for(int i = 0;i < count;i++)
		{
			num = scan.nextInt();
			sum = sum + num;
			if(num < min)
			{
				min = num;
			}
			if(num > max)
			{
				max = num;
			}
		}
		System.out.println(min + " " + max + " " + sum);
	}
}