import java.util.Scanner;
 
class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int a[] = new int[n];
    long sum = 0;
    int min = 1000000;
    int max = -1000000;
    for(int x = 0; x < n; x++){
      a[x] = sc.nextInt();
      sum = sum + a[x];
      if(min > a[x]){
        min = a[x];
      }
      if(max < a[x]){
        max = a[x];
      }
    }
    System.out.println(min+" "+max+" "+sum);
  }
} import java.util.Scanner; Scanner java.util class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int a[] = new int[n];
    long sum = 0;
    int min = 1000000;
    int max = -1000000;
    for(int x = 0; x < n; x++){
      a[x] = sc.nextInt();
      sum = sum + a[x];
      if(min > a[x]){
        min = a[x];
      }
      if(max < a[x]){
        max = a[x];
      }
    }
    System.out.println(min+" "+max+" "+sum);
  }
} Main public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int a[] = new int[n];
    long sum = 0;
    int min = 1000000;
    int max = -1000000;
    for(int x = 0; x < n; x++){
      a[x] = sc.nextInt();
      sum = sum + a[x];
      if(min > a[x]){
        min = a[x];
      }
      if(max < a[x]){
        max = a[x];
      }
    }
    System.out.println(min+" "+max+" "+sum);
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int a[] = new int[n];
    long sum = 0;
    int min = 1000000;
    int max = -1000000;
    for(int x = 0; x < n; x++){
      a[x] = sc.nextInt();
      sum = sum + a[x];
      if(min > a[x]){
        min = a[x];
      }
      if(max < a[x]){
        max = a[x];
      }
    }
    System.out.println(min+" "+max+" "+sum);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int a[] = new int[n]; a new int[n] n long sum = 0; sum 0 int min = 1000000; min 1000000 int max = -1000000; max -1000000 1000000 for(int x = 0; x < n; x++){
      a[x] = sc.nextInt();
      sum = sum + a[x];
      if(min > a[x]){
        min = a[x];
      }
      if(max < a[x]){
        max = a[x];
      }
    } int x = 0; int x = 0; x 0 x < n x n x++ x++ x {
      a[x] = sc.nextInt();
      sum = sum + a[x];
      if(min > a[x]){
        min = a[x];
      }
      if(max < a[x]){
        max = a[x];
      }
    } {
      a[x] = sc.nextInt();
      sum = sum + a[x];
      if(min > a[x]){
        min = a[x];
      }
      if(max < a[x]){
        max = a[x];
      }
    } a[x] = sc.nextInt() a[x] a x sc.nextInt() sc.nextInt sc sum = sum + a[x] sum sum + a[x] sum a[x] a x if(min > a[x]){
        min = a[x];
      } min > a[x] min a[x] a x {
        min = a[x];
      } min = a[x] min a[x] a x if(max < a[x]){
        max = a[x];
      } max < a[x] max a[x] a x {
        max = a[x];
      } max = a[x] max a[x] a x 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 sc = new Scanner(System.in);
    int n = sc.nextInt();
    int a[] = new int[n];
    long sum = 0;
    int min = 1000000;
    int max = -1000000;
    for(int x = 0; x < n; x++){
      a[x] = sc.nextInt();
      sum = sum + a[x];
      if(min > a[x]){
        min = a[x];
      }
      if(max < a[x]){
        max = a[x];
      }
    }
    System.out.println(min+" "+max+" "+sum);
  }
}
