import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

/**
 * Created 2017/06/01.
 */
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();

    ArrayList<Integer> ary = new ArrayList<>();

    while (true) {
      int a = sc.nextInt();
      ary.add(a);
      if (ary.size() == n) break;
    }

    int max_a = Collections.max(ary);
    int min_a = Collections.min(ary);
    long sum_a = 0;
    for (int sum : ary) {
      sum_a += sum;
    }
    System.out.println(min_a + " " + max_a + " " + sum_a);
  }
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();

    ArrayList<Integer> ary = new ArrayList<>();

    while (true) {
      int a = sc.nextInt();
      ary.add(a);
      if (ary.size() == n) break;
    }

    int max_a = Collections.max(ary);
    int min_a = Collections.min(ary);
    long sum_a = 0;
    for (int sum : ary) {
      sum_a += sum;
    }
    System.out.println(min_a + " " + max_a + " " + sum_a);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();

    ArrayList<Integer> ary = new ArrayList<>();

    while (true) {
      int a = sc.nextInt();
      ary.add(a);
      if (ary.size() == n) break;
    }

    int max_a = Collections.max(ary);
    int min_a = Collections.min(ary);
    long sum_a = 0;
    for (int sum : ary) {
      sum_a += sum;
    }
    System.out.println(min_a + " " + max_a + " " + sum_a);
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();

    ArrayList<Integer> ary = new ArrayList<>();

    while (true) {
      int a = sc.nextInt();
      ary.add(a);
      if (ary.size() == n) break;
    }

    int max_a = Collections.max(ary);
    int min_a = Collections.min(ary);
    long sum_a = 0;
    for (int sum : ary) {
      sum_a += sum;
    }
    System.out.println(min_a + " " + max_a + " " + sum_a);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc ArrayList<Integer> ary = new ArrayList<>(); ary new ArrayList<>() while (true) {
      int a = sc.nextInt();
      ary.add(a);
      if (ary.size() == n) break;
    } true {
      int a = sc.nextInt();
      ary.add(a);
      if (ary.size() == n) break;
    } int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc ary.add(a) ary.add ary a if (ary.size() == n) break; ary.size() == n ary.size() ary.size ary n break; int max_a = Collections.max(ary); max_a Collections.max(ary) Collections.max Collections ary int min_a = Collections.min(ary); min_a Collections.min(ary) Collections.min Collections ary long sum_a = 0; sum_a 0 for (int sum : ary) {
      sum_a += sum;
    } int sum ary {
      sum_a += sum;
    } {
      sum_a += sum;
    } sum_a += sum sum_a sum System.out.println(min_a + " " + max_a + " " + sum_a) System.out.println System.out System System.out min_a + " " + max_a + " " + sum_a " " max_a min_a + " " + max_a + " " + sum_a min_a " " max_a " " sum_a String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();

    ArrayList<Integer> ary = new ArrayList<>();

    while (true) {
      int a = sc.nextInt();
      ary.add(a);
      if (ary.size() == n) break;
    }

    int max_a = Collections.max(ary);
    int min_a = Collections.min(ary);
    long sum_a = 0;
    for (int sum : ary) {
      sum_a += sum;
    }
    System.out.println(min_a + " " + max_a + " " + sum_a);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();

    ArrayList<Integer> ary = new ArrayList<>();

    while (true) {
      int a = sc.nextInt();
      ary.add(a);
      if (ary.size() == n) break;
    }

    int max_a = Collections.max(ary);
    int min_a = Collections.min(ary);
    long sum_a = 0;
    for (int sum : ary) {
      sum_a += sum;
    }
    System.out.println(min_a + " " + max_a + " " + sum_a);
  }
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

/**
 * Created 2017/06/01.
 */
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();

    ArrayList<Integer> ary = new ArrayList<>();

    while (true) {
      int a = sc.nextInt();
      ary.add(a);
      if (ary.size() == n) break;
    }

    int max_a = Collections.max(ary);
    int min_a = Collections.min(ary);
    long sum_a = 0;
    for (int sum : ary) {
      sum_a += sum;
    }
    System.out.println(min_a + " " + max_a + " " + sum_a);
  }
}