
import java.util.Scanner;

public class Main {
	public static void main(String[] args)
	{
		Scanner stdIn = new Scanner(System.in);
		
		int N = stdIn.nextInt();
		
		int y = stdIn.nextInt();
		int min = y;
		int max = y;
		long sum = y;
		
		for(int i=1;i<N;i++)
		{
			int x = stdIn.nextInt();
			sum+=x;
			if(min>x)
			{
				min = x;
			}
			else if(max<x)
			{
				max = x;
			}
		}
		
		System.out.println(min+" "+max+" "+sum);
	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args)
	{
		Scanner stdIn = new Scanner(System.in);
		
		int N = stdIn.nextInt();
		
		int y = stdIn.nextInt();
		int min = y;
		int max = y;
		long sum = y;
		
		for(int i=1;i<N;i++)
		{
			int x = stdIn.nextInt();
			sum+=x;
			if(min>x)
			{
				min = x;
			}
			else if(max<x)
			{
				max = x;
			}
		}
		
		System.out.println(min+" "+max+" "+sum);
	}

} Main public static void main(String[] args)
	{
		Scanner stdIn = new Scanner(System.in);
		
		int N = stdIn.nextInt();
		
		int y = stdIn.nextInt();
		int min = y;
		int max = y;
		long sum = y;
		
		for(int i=1;i<N;i++)
		{
			int x = stdIn.nextInt();
			sum+=x;
			if(min>x)
			{
				min = x;
			}
			else if(max<x)
			{
				max = x;
			}
		}
		
		System.out.println(min+" "+max+" "+sum);
	} main {
		Scanner stdIn = new Scanner(System.in);
		
		int N = stdIn.nextInt();
		
		int y = stdIn.nextInt();
		int min = y;
		int max = y;
		long sum = y;
		
		for(int i=1;i<N;i++)
		{
			int x = stdIn.nextInt();
			sum+=x;
			if(min>x)
			{
				min = x;
			}
			else if(max<x)
			{
				max = x;
			}
		}
		
		System.out.println(min+" "+max+" "+sum);
	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int N = stdIn.nextInt(); N stdIn.nextInt() stdIn.nextInt stdIn int y = stdIn.nextInt(); y stdIn.nextInt() stdIn.nextInt stdIn int min = y; min y int max = y; max y long sum = y; sum y for(int i=1;i<N;i++)
		{
			int x = stdIn.nextInt();
			sum+=x;
			if(min>x)
			{
				min = x;
			}
			else if(max<x)
			{
				max = x;
			}
		} int i=1; int i=1; i 1 i<N i N i++ i++ i {
			int x = stdIn.nextInt();
			sum+=x;
			if(min>x)
			{
				min = x;
			}
			else if(max<x)
			{
				max = x;
			}
		} {
			int x = stdIn.nextInt();
			sum+=x;
			if(min>x)
			{
				min = x;
			}
			else if(max<x)
			{
				max = x;
			}
		} int x = stdIn.nextInt(); x stdIn.nextInt() stdIn.nextInt stdIn sum+=x sum x if(min>x)
			{
				min = x;
			}
			else if(max<x)
			{
				max = x;
			} min>x min x {
				min = x;
			} min = x min x if(max<x)
			{
				max = x;
			} max<x max x {
				max = x;
			} max = x max x 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 stdIn = new Scanner(System.in);
		
		int N = stdIn.nextInt();
		
		int y = stdIn.nextInt();
		int min = y;
		int max = y;
		long sum = y;
		
		for(int i=1;i<N;i++)
		{
			int x = stdIn.nextInt();
			sum+=x;
			if(min>x)
			{
				min = x;
			}
			else if(max<x)
			{
				max = x;
			}
		}
		
		System.out.println(min+" "+max+" "+sum);
	}

} public class Main {
	public static void main(String[] args)
	{
		Scanner stdIn = new Scanner(System.in);
		
		int N = stdIn.nextInt();
		
		int y = stdIn.nextInt();
		int min = y;
		int max = y;
		long sum = y;
		
		for(int i=1;i<N;i++)
		{
			int x = stdIn.nextInt();
			sum+=x;
			if(min>x)
			{
				min = x;
			}
			else if(max<x)
			{
				max = x;
			}
		}
		
		System.out.println(min+" "+max+" "+sum);
	}

} Main

import java.util.Scanner;

public class Main {
	public static void main(String[] args)
	{
		Scanner stdIn = new Scanner(System.in);
		
		int N = stdIn.nextInt();
		
		int y = stdIn.nextInt();
		int min = y;
		int max = y;
		long sum = y;
		
		for(int i=1;i<N;i++)
		{
			int x = stdIn.nextInt();
			sum+=x;
			if(min>x)
			{
				min = x;
			}
			else if(max<x)
			{
				max = x;
			}
		}
		
		System.out.println(min+" "+max+" "+sum);
	}

}