import java.util.Scanner;

/**
 * @author kawakami
 *
 */
class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner as = new Scanner(System.in);
		
		int n=as.nextInt();
		long tr,min,max,sum;
		int j = 0,k = 0;
		long jug[] = new long[n];
		
		
		
		jug[0]=as.nextInt();
		//System.out.println("test3 "+jug[0]);
		max=jug[0];
		min=jug[0];
		sum=jug[0];
		
		
		for(int i=1;i<n;i++){
			//System.out.println("test4");
			jug[i]=as.nextInt();
			sum=sum+jug[i];
			//System.out.println(sum+" test1 "+jug[i]);
		}
		while(j!=1){
			j=1;
			//System.out.println("test2");
			for(k = 0;k<n-1;k++){
				
				if(jug[k]>jug[k+1]){
					tr=jug[k];
					jug[k]=jug[k+1];
					jug[k+1]=tr;
					j=0;
				}
			}
			
			
		}
		System.out.println(jug[0]+" "+jug[k]+" "+sum);

	}

} import java.util.Scanner; Scanner java.util class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner as = new Scanner(System.in);
		
		int n=as.nextInt();
		long tr,min,max,sum;
		int j = 0,k = 0;
		long jug[] = new long[n];
		
		
		
		jug[0]=as.nextInt();
		//System.out.println("test3 "+jug[0]);
		max=jug[0];
		min=jug[0];
		sum=jug[0];
		
		
		for(int i=1;i<n;i++){
			//System.out.println("test4");
			jug[i]=as.nextInt();
			sum=sum+jug[i];
			//System.out.println(sum+" test1 "+jug[i]);
		}
		while(j!=1){
			j=1;
			//System.out.println("test2");
			for(k = 0;k<n-1;k++){
				
				if(jug[k]>jug[k+1]){
					tr=jug[k];
					jug[k]=jug[k+1];
					jug[k+1]=tr;
					j=0;
				}
			}
			
			
		}
		System.out.println(jug[0]+" "+jug[k]+" "+sum);

	}

} Main /**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner as = new Scanner(System.in);
		
		int n=as.nextInt();
		long tr,min,max,sum;
		int j = 0,k = 0;
		long jug[] = new long[n];
		
		
		
		jug[0]=as.nextInt();
		//System.out.println("test3 "+jug[0]);
		max=jug[0];
		min=jug[0];
		sum=jug[0];
		
		
		for(int i=1;i<n;i++){
			//System.out.println("test4");
			jug[i]=as.nextInt();
			sum=sum+jug[i];
			//System.out.println(sum+" test1 "+jug[i]);
		}
		while(j!=1){
			j=1;
			//System.out.println("test2");
			for(k = 0;k<n-1;k++){
				
				if(jug[k]>jug[k+1]){
					tr=jug[k];
					jug[k]=jug[k+1];
					jug[k+1]=tr;
					j=0;
				}
			}
			
			
		}
		System.out.println(jug[0]+" "+jug[k]+" "+sum);

	} main {
		// TODO Auto-generated method stub
		Scanner as = new Scanner(System.in);
		
		int n=as.nextInt();
		long tr,min,max,sum;
		int j = 0,k = 0;
		long jug[] = new long[n];
		
		
		
		jug[0]=as.nextInt();
		//System.out.println("test3 "+jug[0]);
		max=jug[0];
		min=jug[0];
		sum=jug[0];
		
		
		for(int i=1;i<n;i++){
			//System.out.println("test4");
			jug[i]=as.nextInt();
			sum=sum+jug[i];
			//System.out.println(sum+" test1 "+jug[i]);
		}
		while(j!=1){
			j=1;
			//System.out.println("test2");
			for(k = 0;k<n-1;k++){
				
				if(jug[k]>jug[k+1]){
					tr=jug[k];
					jug[k]=jug[k+1];
					jug[k+1]=tr;
					j=0;
				}
			}
			
			
		}
		System.out.println(jug[0]+" "+jug[k]+" "+sum);

	} Scanner as = new Scanner(System.in); as new Scanner(System.in) int n=as.nextInt(); n as.nextInt() as.nextInt as long tr tr min min max max sum; sum int j = 0 j 0 k = 0; k 0 long jug[] = new long[n]; jug new long[n] n jug[0]=as.nextInt() jug[0] jug 0 as.nextInt() as.nextInt as max=jug[0] max jug[0] jug 0 min=jug[0] min jug[0] jug 0 sum=jug[0] sum jug[0] jug 0 for(int i=1;i<n;i++){
			//System.out.println("test4");
			jug[i]=as.nextInt();
			sum=sum+jug[i];
			//System.out.println(sum+" test1 "+jug[i]);
		} int i=1; int i=1; i 1 i<n i n i++ i++ i {
			//System.out.println("test4");
			jug[i]=as.nextInt();
			sum=sum+jug[i];
			//System.out.println(sum+" test1 "+jug[i]);
		} {
			//System.out.println("test4");
			jug[i]=as.nextInt();
			sum=sum+jug[i];
			//System.out.println(sum+" test1 "+jug[i]);
		} jug[i]=as.nextInt() jug[i] jug i as.nextInt() as.nextInt as sum=sum+jug[i] sum sum+jug[i] sum jug[i] jug i while(j!=1){
			j=1;
			//System.out.println("test2");
			for(k = 0;k<n-1;k++){
				
				if(jug[k]>jug[k+1]){
					tr=jug[k];
					jug[k]=jug[k+1];
					jug[k+1]=tr;
					j=0;
				}
			}
			
			
		} j!=1 j 1 {
			j=1;
			//System.out.println("test2");
			for(k = 0;k<n-1;k++){
				
				if(jug[k]>jug[k+1]){
					tr=jug[k];
					jug[k]=jug[k+1];
					jug[k+1]=tr;
					j=0;
				}
			}
			
			
		} j=1 j 1 for(k = 0;k<n-1;k++){
				
				if(jug[k]>jug[k+1]){
					tr=jug[k];
					jug[k]=jug[k+1];
					jug[k+1]=tr;
					j=0;
				}
			} k = 0; k = 0 k 0 k<n-1 k n-1 n 1 k++ k++ k {
				
				if(jug[k]>jug[k+1]){
					tr=jug[k];
					jug[k]=jug[k+1];
					jug[k+1]=tr;
					j=0;
				}
			} {
				
				if(jug[k]>jug[k+1]){
					tr=jug[k];
					jug[k]=jug[k+1];
					jug[k+1]=tr;
					j=0;
				}
			} if(jug[k]>jug[k+1]){
					tr=jug[k];
					jug[k]=jug[k+1];
					jug[k+1]=tr;
					j=0;
				} jug[k]>jug[k+1] jug[k] jug k jug[k+1] jug k+1 k 1 {
					tr=jug[k];
					jug[k]=jug[k+1];
					jug[k+1]=tr;
					j=0;
				} tr=jug[k] tr jug[k] jug k jug[k]=jug[k+1] jug[k] jug k jug[k+1] jug k+1 k 1 jug[k+1]=tr jug[k+1] jug k+1 k 1 tr j=0 j 0 System.out.println(jug[0]+" "+jug[k]+" "+sum) System.out.println System.out System System.out jug[0]+" "+jug[k]+" "+sum " " jug[k] jug[0]+" "+jug[k]+" "+sum jug[0] jug 0 " " jug[k] jug k " " sum String[] args args
import java.util.Scanner;

/**
 * @author kawakami
 *
 */
class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner as = new Scanner(System.in);
		
		int n=as.nextInt();
		long tr,min,max,sum;
		int j = 0,k = 0;
		long jug[] = new long[n];
		
		
		
		jug[0]=as.nextInt();
		//System.out.println("test3 "+jug[0]);
		max=jug[0];
		min=jug[0];
		sum=jug[0];
		
		
		for(int i=1;i<n;i++){
			//System.out.println("test4");
			jug[i]=as.nextInt();
			sum=sum+jug[i];
			//System.out.println(sum+" test1 "+jug[i]);
		}
		while(j!=1){
			j=1;
			//System.out.println("test2");
			for(k = 0;k<n-1;k++){
				
				if(jug[k]>jug[k+1]){
					tr=jug[k];
					jug[k]=jug[k+1];
					jug[k+1]=tr;
					j=0;
				}
			}
			
			
		}
		System.out.println(jug[0]+" "+jug[k]+" "+sum);

	}

}