import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    int min, max;
    long sum = 0;
    sum = min = max = scan.nextInt();
    for(int i = 1; i < n; i++){
      int ai = scan.nextInt();
      if(min > ai){
        min = ai;
      }
      if(max < ai){
        max = ai;
      }
      sum += ai;
    }
    System.out.println(min + " " + max + " " + sum);
  }
} import java.util.Scanner; Scanner java.util class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    int min, max;
    long sum = 0;
    sum = min = max = scan.nextInt();
    for(int i = 1; i < n; i++){
      int ai = scan.nextInt();
      if(min > ai){
        min = ai;
      }
      if(max < ai){
        max = ai;
      }
      sum += ai;
    }
    System.out.println(min + " " + max + " " + sum);
  }
} Main public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    int min, max;
    long sum = 0;
    sum = min = max = scan.nextInt();
    for(int i = 1; i < n; i++){
      int ai = scan.nextInt();
      if(min > ai){
        min = ai;
      }
      if(max < ai){
        max = ai;
      }
      sum += ai;
    }
    System.out.println(min + " " + max + " " + sum);
  } main {
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    int min, max;
    long sum = 0;
    sum = min = max = scan.nextInt();
    for(int i = 1; i < n; i++){
      int ai = scan.nextInt();
      if(min > ai){
        min = ai;
      }
      if(max < ai){
        max = ai;
      }
      sum += ai;
    }
    System.out.println(min + " " + max + " " + sum);
  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int min min max; max long sum = 0; sum 0 sum = min = max = scan.nextInt() sum min = max = scan.nextInt() min max = scan.nextInt() max scan.nextInt() scan.nextInt scan for(int i = 1; i < n; i++){
      int ai = scan.nextInt();
      if(min > ai){
        min = ai;
      }
      if(max < ai){
        max = ai;
      }
      sum += ai;
    } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
      int ai = scan.nextInt();
      if(min > ai){
        min = ai;
      }
      if(max < ai){
        max = ai;
      }
      sum += ai;
    } {
      int ai = scan.nextInt();
      if(min > ai){
        min = ai;
      }
      if(max < ai){
        max = ai;
      }
      sum += ai;
    } int ai = scan.nextInt(); ai scan.nextInt() scan.nextInt scan if(min > ai){
        min = ai;
      } min > ai min ai {
        min = ai;
      } min = ai min ai if(max < ai){
        max = ai;
      } max < ai max ai {
        max = ai;
      } max = ai max ai sum += ai sum ai System.out.println(min + " " + max + " " + sum) System.out.println System.out System System.out min + " " + max + " " + sum " " max min + " " + max + " " + sum min " " max " " sum String[] args args
import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    int min, max;
    long sum = 0;
    sum = min = max = scan.nextInt();
    for(int i = 1; i < n; i++){
      int ai = scan.nextInt();
      if(min > ai){
        min = ai;
      }
      if(max < ai){
        max = ai;
      }
      sum += ai;
    }
    System.out.println(min + " " + max + " " + sum);
  }
}