import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner stdin = new Scanner(System.in);
    int n = stdin.nextInt();
    int min = 0;
    int max = 0;
    long sum = 0;

    for (int i = 0; i < n; i++) {
      int m = stdin.nextInt();
      sum += m;

      if (i == 0) {
        min = m;
        max = m;
      } else {
        min = Math.min(min, m);
        max = Math.max(max, m);
      }
    }

    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 stdin = new Scanner(System.in);
    int n = stdin.nextInt();
    int min = 0;
    int max = 0;
    long sum = 0;

    for (int i = 0; i < n; i++) {
      int m = stdin.nextInt();
      sum += m;

      if (i == 0) {
        min = m;
        max = m;
      } else {
        min = Math.min(min, m);
        max = Math.max(max, m);
      }
    }

    System.out.printf("%d %d %d%n", min, max, sum);
  }

} Main public static void main(String[] args) {
    Scanner stdin = new Scanner(System.in);
    int n = stdin.nextInt();
    int min = 0;
    int max = 0;
    long sum = 0;

    for (int i = 0; i < n; i++) {
      int m = stdin.nextInt();
      sum += m;

      if (i == 0) {
        min = m;
        max = m;
      } else {
        min = Math.min(min, m);
        max = Math.max(max, m);
      }
    }

    System.out.printf("%d %d %d%n", min, max, sum);
  } main {
    Scanner stdin = new Scanner(System.in);
    int n = stdin.nextInt();
    int min = 0;
    int max = 0;
    long sum = 0;

    for (int i = 0; i < n; i++) {
      int m = stdin.nextInt();
      sum += m;

      if (i == 0) {
        min = m;
        max = m;
      } else {
        min = Math.min(min, m);
        max = Math.max(max, m);
      }
    }

    System.out.printf("%d %d %d%n", min, max, sum);
  } Scanner stdin = new Scanner(System.in); stdin new Scanner(System.in) int n = stdin.nextInt(); n stdin.nextInt() stdin.nextInt stdin int min = 0; min 0 int max = 0; max 0 long sum = 0; sum 0 for (int i = 0; i < n; i++) {
      int m = stdin.nextInt();
      sum += m;

      if (i == 0) {
        min = m;
        max = m;
      } else {
        min = Math.min(min, m);
        max = Math.max(max, m);
      }
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      int m = stdin.nextInt();
      sum += m;

      if (i == 0) {
        min = m;
        max = m;
      } else {
        min = Math.min(min, m);
        max = Math.max(max, m);
      }
    } {
      int m = stdin.nextInt();
      sum += m;

      if (i == 0) {
        min = m;
        max = m;
      } else {
        min = Math.min(min, m);
        max = Math.max(max, m);
      }
    } int m = stdin.nextInt(); m stdin.nextInt() stdin.nextInt stdin sum += m sum m if (i == 0) {
        min = m;
        max = m;
      } else {
        min = Math.min(min, m);
        max = Math.max(max, m);
      } i == 0 i 0 {
        min = m;
        max = m;
      } min = m min m max = m max m {
        min = Math.min(min, m);
        max = Math.max(max, m);
      } min = Math.min(min, m) min Math.min(min, m) Math.min Math min m max = Math.max(max, m) max Math.max(max, m) Math.max Math max m 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 stdin = new Scanner(System.in);
    int n = stdin.nextInt();
    int min = 0;
    int max = 0;
    long sum = 0;

    for (int i = 0; i < n; i++) {
      int m = stdin.nextInt();
      sum += m;

      if (i == 0) {
        min = m;
        max = m;
      } else {
        min = Math.min(min, m);
        max = Math.max(max, m);
      }
    }

    System.out.printf("%d %d %d%n", min, max, sum);
  }

} public class Main {

  public static void main(String[] args) {
    Scanner stdin = new Scanner(System.in);
    int n = stdin.nextInt();
    int min = 0;
    int max = 0;
    long sum = 0;

    for (int i = 0; i < n; i++) {
      int m = stdin.nextInt();
      sum += m;

      if (i == 0) {
        min = m;
        max = m;
      } else {
        min = Math.min(min, m);
        max = Math.max(max, m);
      }
    }

    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 stdin = new Scanner(System.in);
    int n = stdin.nextInt();
    int min = 0;
    int max = 0;
    long sum = 0;

    for (int i = 0; i < n; i++) {
      int m = stdin.nextInt();
      sum += m;

      if (i == 0) {
        min = m;
        max = m;
      } else {
        min = Math.min(min, m);
        max = Math.max(max, m);
      }
    }

    System.out.printf("%d %d %d%n", min, max, sum);
  }

}