import java.util.Scanner;


public class Main {
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		
		int n = scanner.nextInt();
		int[] a = new int[10000];
		
		int max= -1000000;
		int min = 1000000;
		long sum = 0;
		for(int i=0; i<n; i++)
		{
			a[i] = scanner.nextInt();
			if(i == 0)
			{
				max = a[0];
				min = a[0];
			}
			else
			{
					if(a[i] > max)
					{
						max = a[i];
					}
					else if(a[i] < min)
					{
						min = a[i];
					}
			}
			
			sum += a[i];
		}
		
		System.out.printf("%1$d %2$d %3$d\n", min, max, sum);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		
		int n = scanner.nextInt();
		int[] a = new int[10000];
		
		int max= -1000000;
		int min = 1000000;
		long sum = 0;
		for(int i=0; i<n; i++)
		{
			a[i] = scanner.nextInt();
			if(i == 0)
			{
				max = a[0];
				min = a[0];
			}
			else
			{
					if(a[i] > max)
					{
						max = a[i];
					}
					else if(a[i] < min)
					{
						min = a[i];
					}
			}
			
			sum += a[i];
		}
		
		System.out.printf("%1$d %2$d %3$d\n", min, max, sum);
	}
} Main public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		
		int n = scanner.nextInt();
		int[] a = new int[10000];
		
		int max= -1000000;
		int min = 1000000;
		long sum = 0;
		for(int i=0; i<n; i++)
		{
			a[i] = scanner.nextInt();
			if(i == 0)
			{
				max = a[0];
				min = a[0];
			}
			else
			{
					if(a[i] > max)
					{
						max = a[i];
					}
					else if(a[i] < min)
					{
						min = a[i];
					}
			}
			
			sum += a[i];
		}
		
		System.out.printf("%1$d %2$d %3$d\n", min, max, sum);
	} main {
		Scanner scanner = new Scanner(System.in);
		
		int n = scanner.nextInt();
		int[] a = new int[10000];
		
		int max= -1000000;
		int min = 1000000;
		long sum = 0;
		for(int i=0; i<n; i++)
		{
			a[i] = scanner.nextInt();
			if(i == 0)
			{
				max = a[0];
				min = a[0];
			}
			else
			{
					if(a[i] > max)
					{
						max = a[i];
					}
					else if(a[i] < min)
					{
						min = a[i];
					}
			}
			
			sum += a[i];
		}
		
		System.out.printf("%1$d %2$d %3$d\n", min, max, sum);
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int[] a = new int[10000]; a new int[10000] 10000 int max= -1000000; max -1000000 1000000 int min = 1000000; min 1000000 long sum = 0; sum 0 for(int i=0; i<n; i++)
		{
			a[i] = scanner.nextInt();
			if(i == 0)
			{
				max = a[0];
				min = a[0];
			}
			else
			{
					if(a[i] > max)
					{
						max = a[i];
					}
					else if(a[i] < min)
					{
						min = a[i];
					}
			}
			
			sum += a[i];
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			a[i] = scanner.nextInt();
			if(i == 0)
			{
				max = a[0];
				min = a[0];
			}
			else
			{
					if(a[i] > max)
					{
						max = a[i];
					}
					else if(a[i] < min)
					{
						min = a[i];
					}
			}
			
			sum += a[i];
		} {
			a[i] = scanner.nextInt();
			if(i == 0)
			{
				max = a[0];
				min = a[0];
			}
			else
			{
					if(a[i] > max)
					{
						max = a[i];
					}
					else if(a[i] < min)
					{
						min = a[i];
					}
			}
			
			sum += a[i];
		} a[i] = scanner.nextInt() a[i] a i scanner.nextInt() scanner.nextInt scanner if(i == 0)
			{
				max = a[0];
				min = a[0];
			}
			else
			{
					if(a[i] > max)
					{
						max = a[i];
					}
					else if(a[i] < min)
					{
						min = a[i];
					}
			} i == 0 i 0 {
				max = a[0];
				min = a[0];
			} max = a[0] max a[0] a 0 min = a[0] min a[0] a 0 {
					if(a[i] > max)
					{
						max = a[i];
					}
					else if(a[i] < min)
					{
						min = a[i];
					}
			} if(a[i] > max)
					{
						max = a[i];
					}
					else if(a[i] < min)
					{
						min = a[i];
					} a[i] > max a[i] a i max {
						max = a[i];
					} max = a[i] max a[i] a i if(a[i] < min)
					{
						min = a[i];
					} a[i] < min a[i] a i min {
						min = a[i];
					} min = a[i] min a[i] a i sum += a[i] sum a[i] a i System.out.printf("%1$d %2$d %3$d\n", min, max, sum) System.out.printf System.out System System.out "%1$d %2$d %3$d\n" min max sum String[] args args public class Main {
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		
		int n = scanner.nextInt();
		int[] a = new int[10000];
		
		int max= -1000000;
		int min = 1000000;
		long sum = 0;
		for(int i=0; i<n; i++)
		{
			a[i] = scanner.nextInt();
			if(i == 0)
			{
				max = a[0];
				min = a[0];
			}
			else
			{
					if(a[i] > max)
					{
						max = a[i];
					}
					else if(a[i] < min)
					{
						min = a[i];
					}
			}
			
			sum += a[i];
		}
		
		System.out.printf("%1$d %2$d %3$d\n", min, max, sum);
	}
} public class Main {
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		
		int n = scanner.nextInt();
		int[] a = new int[10000];
		
		int max= -1000000;
		int min = 1000000;
		long sum = 0;
		for(int i=0; i<n; i++)
		{
			a[i] = scanner.nextInt();
			if(i == 0)
			{
				max = a[0];
				min = a[0];
			}
			else
			{
					if(a[i] > max)
					{
						max = a[i];
					}
					else if(a[i] < min)
					{
						min = a[i];
					}
			}
			
			sum += a[i];
		}
		
		System.out.printf("%1$d %2$d %3$d\n", min, max, sum);
	}
} Main
import java.util.Scanner;


public class Main {
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		
		int n = scanner.nextInt();
		int[] a = new int[10000];
		
		int max= -1000000;
		int min = 1000000;
		long sum = 0;
		for(int i=0; i<n; i++)
		{
			a[i] = scanner.nextInt();
			if(i == 0)
			{
				max = a[0];
				min = a[0];
			}
			else
			{
					if(a[i] > max)
					{
						max = a[i];
					}
					else if(a[i] < min)
					{
						min = a[i];
					}
			}
			
			sum += a[i];
		}
		
		System.out.printf("%1$d %2$d %3$d\n", min, max, sum);
	}
}