import java.util.Scanner;

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

} import java.util.Scanner; Scanner java.util class Main
{
  public static void main(String[] args)
  {
    int Max=-1000000,min=1000000,n,temp;
    long sum=0;
    Scanner in=new Scanner(System.in);
	
	n=in.nextInt();
	for(int i=0;i<n;i++)
	{
		temp=in.nextInt();
		if(temp>Max)
			Max=temp;
		if(temp<min)
			min=temp;
		sum+=temp;		
	}
	System.out.println(min + " " + Max + " " + sum);
    
  }

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

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

}