import java.util.Scanner;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();

    long k = 0;
    int max = -1000001;
    int min = 1000001;
      for ( int i = 1 ; i <= a ; i++){
        int b = sc.nextInt();
        if ( b > max ){
          max = b;
        }
        if ( b < min ){
          min = b;
        }
        k = k + b;
      }
      System.out.println(min + " " + max + " " + k);
  }
}
 import java.util.Scanner; Scanner java.util class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();

    long k = 0;
    int max = -1000001;
    int min = 1000001;
      for ( int i = 1 ; i <= a ; i++){
        int b = sc.nextInt();
        if ( b > max ){
          max = b;
        }
        if ( b < min ){
          min = b;
        }
        k = k + b;
      }
      System.out.println(min + " " + max + " " + k);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();

    long k = 0;
    int max = -1000001;
    int min = 1000001;
      for ( int i = 1 ; i <= a ; i++){
        int b = sc.nextInt();
        if ( b > max ){
          max = b;
        }
        if ( b < min ){
          min = b;
        }
        k = k + b;
      }
      System.out.println(min + " " + max + " " + k);
  } main {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();

    long k = 0;
    int max = -1000001;
    int min = 1000001;
      for ( int i = 1 ; i <= a ; i++){
        int b = sc.nextInt();
        if ( b > max ){
          max = b;
        }
        if ( b < min ){
          min = b;
        }
        k = k + b;
      }
      System.out.println(min + " " + max + " " + k);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc long k = 0; k 0 int max = -1000001; max -1000001 1000001 int min = 1000001; min 1000001 for ( int i = 1 ; i <= a ; i++){
        int b = sc.nextInt();
        if ( b > max ){
          max = b;
        }
        if ( b < min ){
          min = b;
        }
        k = k + b;
      } int i = 1 ; int i = 1 ; i 1 i <= a i a i++ i++ i {
        int b = sc.nextInt();
        if ( b > max ){
          max = b;
        }
        if ( b < min ){
          min = b;
        }
        k = k + b;
      } {
        int b = sc.nextInt();
        if ( b > max ){
          max = b;
        }
        if ( b < min ){
          min = b;
        }
        k = k + b;
      } int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc if ( b > max ){
          max = b;
        } b > max b max {
          max = b;
        } max = b max b if ( b < min ){
          min = b;
        } b < min b min {
          min = b;
        } min = b min b k = k + b k k + b k b System.out.println(min + " " + max + " " + k) System.out.println System.out System System.out min + " " + max + " " + k " " max min + " " + max + " " + k min " " max " " k String[] args args
import java.util.Scanner;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();

    long k = 0;
    int max = -1000001;
    int min = 1000001;
      for ( int i = 1 ; i <= a ; i++){
        int b = sc.nextInt();
        if ( b > max ){
          max = b;
        }
        if ( b < min ){
          min = b;
        }
        k = k + b;
      }
      System.out.println(min + " " + max + " " + k);
  }
}

