import java.io.IOException;
import java.util.Scanner;
public class Main {

	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????
       Scanner sc = new Scanner(System.in);
       int n = sc.nextInt();
       long a,b,c,d,e;
       a=2;
       b = sc.nextLong();
       c = b;
       d = b;
       e = b;
       while(a<=n){
    	   b = sc.nextLong();
    	   c = c + b;
    	   if (b > d){
    		   d = b;
    	   }else if (b < e){e = b;}
    	   a = a+1;
       }
       System.out.println(e + " " + d + " " + c);
	}

} import java.io.IOException; IOException java.io import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????
       Scanner sc = new Scanner(System.in);
       int n = sc.nextInt();
       long a,b,c,d,e;
       a=2;
       b = sc.nextLong();
       c = b;
       d = b;
       e = b;
       while(a<=n){
    	   b = sc.nextLong();
    	   c = c + b;
    	   if (b > d){
    		   d = b;
    	   }else if (b < e){e = b;}
    	   a = a+1;
       }
       System.out.println(e + " " + d + " " + c);
	}

} Main public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????
       Scanner sc = new Scanner(System.in);
       int n = sc.nextInt();
       long a,b,c,d,e;
       a=2;
       b = sc.nextLong();
       c = b;
       d = b;
       e = b;
       while(a<=n){
    	   b = sc.nextLong();
    	   c = c + b;
    	   if (b > d){
    		   d = b;
    	   }else if (b < e){e = b;}
    	   a = a+1;
       }
       System.out.println(e + " " + d + " " + c);
	} main {
		// TODO ?????????????????????????????????????????????
       Scanner sc = new Scanner(System.in);
       int n = sc.nextInt();
       long a,b,c,d,e;
       a=2;
       b = sc.nextLong();
       c = b;
       d = b;
       e = b;
       while(a<=n){
    	   b = sc.nextLong();
    	   c = c + b;
    	   if (b > d){
    		   d = b;
    	   }else if (b < e){e = b;}
    	   a = a+1;
       }
       System.out.println(e + " " + d + " " + c);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc long a a b b c c d d e; e a=2 a 2 b = sc.nextLong() b sc.nextLong() sc.nextLong sc c = b c b d = b d b e = b e b while(a<=n){
    	   b = sc.nextLong();
    	   c = c + b;
    	   if (b > d){
    		   d = b;
    	   }else if (b < e){e = b;}
    	   a = a+1;
       } a<=n a n {
    	   b = sc.nextLong();
    	   c = c + b;
    	   if (b > d){
    		   d = b;
    	   }else if (b < e){e = b;}
    	   a = a+1;
       } b = sc.nextLong() b sc.nextLong() sc.nextLong sc c = c + b c c + b c b if (b > d){
    		   d = b;
    	   }else if (b < e){e = b;} b > d b d {
    		   d = b;
    	   } d = b d b if (b < e){e = b;} b < e b e {e = b;} e = b e b a = a+1 a a+1 a 1 System.out.println(e + " " + d + " " + c) System.out.println System.out System System.out e + " " + d + " " + c " " d e + " " + d + " " + c e " " d " " c String[] args args public class Main {

	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????
       Scanner sc = new Scanner(System.in);
       int n = sc.nextInt();
       long a,b,c,d,e;
       a=2;
       b = sc.nextLong();
       c = b;
       d = b;
       e = b;
       while(a<=n){
    	   b = sc.nextLong();
    	   c = c + b;
    	   if (b > d){
    		   d = b;
    	   }else if (b < e){e = b;}
    	   a = a+1;
       }
       System.out.println(e + " " + d + " " + c);
	}

} public class Main {

	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????
       Scanner sc = new Scanner(System.in);
       int n = sc.nextInt();
       long a,b,c,d,e;
       a=2;
       b = sc.nextLong();
       c = b;
       d = b;
       e = b;
       while(a<=n){
    	   b = sc.nextLong();
    	   c = c + b;
    	   if (b > d){
    		   d = b;
    	   }else if (b < e){e = b;}
    	   a = a+1;
       }
       System.out.println(e + " " + d + " " + c);
	}

} Main
import java.io.IOException;
import java.util.Scanner;
public class Main {

	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????
       Scanner sc = new Scanner(System.in);
       int n = sc.nextInt();
       long a,b,c,d,e;
       a=2;
       b = sc.nextLong();
       c = b;
       d = b;
       e = b;
       while(a<=n){
    	   b = sc.nextLong();
    	   c = c + b;
    	   if (b > d){
    		   d = b;
    	   }else if (b < e){e = b;}
    	   a = a+1;
       }
       System.out.println(e + " " + d + " " + c);
	}

}