import java.util.Scanner;

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

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