import java.util.*;

class Main {
   public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      int n = Integer.parseInt(sc.next());
      int[] a = new int[n];
      long sum = 0;
      for (int i = 0; i < n; i++) {
         a[i] = Integer.parseInt(sc.next());
         sum += a[i];
      }
      int max = a[0];
      int min = a[0];
      for (int i = 1; i < n; i++ ) {
         if (max < a[i]) {
            max = a[i];
         } else if (min > a[i]) {
            min = a[i];
         }
      }
      System.out.printf("%d %d %d\n", min, max, sum);
   }
} import java.util.*; util.* java class Main {
   public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      int n = Integer.parseInt(sc.next());
      int[] a = new int[n];
      long sum = 0;
      for (int i = 0; i < n; i++) {
         a[i] = Integer.parseInt(sc.next());
         sum += a[i];
      }
      int max = a[0];
      int min = a[0];
      for (int i = 1; i < n; i++ ) {
         if (max < a[i]) {
            max = a[i];
         } else if (min > a[i]) {
            min = a[i];
         }
      }
      System.out.printf("%d %d %d\n", min, max, sum);
   }
} Main public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      int n = Integer.parseInt(sc.next());
      int[] a = new int[n];
      long sum = 0;
      for (int i = 0; i < n; i++) {
         a[i] = Integer.parseInt(sc.next());
         sum += a[i];
      }
      int max = a[0];
      int min = a[0];
      for (int i = 1; i < n; i++ ) {
         if (max < a[i]) {
            max = a[i];
         } else if (min > a[i]) {
            min = a[i];
         }
      }
      System.out.printf("%d %d %d\n", min, max, sum);
   } main {
      Scanner sc = new Scanner(System.in);
      int n = Integer.parseInt(sc.next());
      int[] a = new int[n];
      long sum = 0;
      for (int i = 0; i < n; i++) {
         a[i] = Integer.parseInt(sc.next());
         sum += a[i];
      }
      int max = a[0];
      int min = a[0];
      for (int i = 1; i < n; i++ ) {
         if (max < a[i]) {
            max = a[i];
         } else if (min > a[i]) {
            min = a[i];
         }
      }
      System.out.printf("%d %d %d\n", min, max, sum);
   } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int[] a = new int[n]; a new int[n] n long sum = 0; sum 0 for (int i = 0; i < n; i++) {
         a[i] = Integer.parseInt(sc.next());
         sum += a[i];
      } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
         a[i] = Integer.parseInt(sc.next());
         sum += a[i];
      } {
         a[i] = Integer.parseInt(sc.next());
         sum += a[i];
      } a[i] = Integer.parseInt(sc.next()) a[i] a i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc sum += a[i] sum a[i] a i int max = a[0]; max a[0] a 0 int min = a[0]; min a[0] a 0 for (int i = 1; i < n; i++ ) {
         if (max < a[i]) {
            max = a[i];
         } else if (min > a[i]) {
            min = a[i];
         }
      } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
         if (max < a[i]) {
            max = a[i];
         } else if (min > a[i]) {
            min = a[i];
         }
      } {
         if (max < a[i]) {
            max = a[i];
         } else if (min > a[i]) {
            min = a[i];
         }
      } if (max < a[i]) {
            max = a[i];
         } else if (min > a[i]) {
            min = a[i];
         } max < a[i] max a[i] a i {
            max = a[i];
         } max = a[i] max a[i] a i if (min > a[i]) {
            min = a[i];
         } min > a[i] min a[i] a i {
            min = a[i];
         } min = a[i] min a[i] a 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
import java.util.*;

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