import java.util.*;
import java.io.*;

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

   int n = sc.nextInt();
   long sum = 0;
   int min = 1000000;
   int max = -1000000;

   for(int i=0; i<n; i++){
       int a = sc.nextInt();
       sum += a;
       if(a < min){
           min = a;
       }
       if(a > max){
           max = a;
       }
   }

    System.out.println(min + " " + max + " " + sum);
 }
} import java.util.*; util.* java import java.io.*; io.* java public class Main{
 public static void main(String[] args) throws IOException
 {
   Scanner sc = new Scanner(System.in);

   int n = sc.nextInt();
   long sum = 0;
   int min = 1000000;
   int max = -1000000;

   for(int i=0; i<n; i++){
       int a = sc.nextInt();
       sum += a;
       if(a < min){
           min = a;
       }
       if(a > max){
           max = a;
       }
   }

    System.out.println(min + " " + max + " " + sum);
 }
} Main public static void main(String[] args) throws IOException
 {
   Scanner sc = new Scanner(System.in);

   int n = sc.nextInt();
   long sum = 0;
   int min = 1000000;
   int max = -1000000;

   for(int i=0; i<n; i++){
       int a = sc.nextInt();
       sum += a;
       if(a < min){
           min = a;
       }
       if(a > max){
           max = a;
       }
   }

    System.out.println(min + " " + max + " " + sum);
 } main {
   Scanner sc = new Scanner(System.in);

   int n = sc.nextInt();
   long sum = 0;
   int min = 1000000;
   int max = -1000000;

   for(int i=0; i<n; i++){
       int a = sc.nextInt();
       sum += a;
       if(a < min){
           min = a;
       }
       if(a > max){
           max = a;
       }
   }

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

   int n = sc.nextInt();
   long sum = 0;
   int min = 1000000;
   int max = -1000000;

   for(int i=0; i<n; i++){
       int a = sc.nextInt();
       sum += a;
       if(a < min){
           min = a;
       }
       if(a > max){
           max = a;
       }
   }

    System.out.println(min + " " + max + " " + sum);
 }
} public class Main{
 public static void main(String[] args) throws IOException
 {
   Scanner sc = new Scanner(System.in);

   int n = sc.nextInt();
   long sum = 0;
   int min = 1000000;
   int max = -1000000;

   for(int i=0; i<n; i++){
       int a = sc.nextInt();
       sum += a;
       if(a < min){
           min = a;
       }
       if(a > max){
           max = a;
       }
   }

    System.out.println(min + " " + max + " " + sum);
 }
} Main
import java.util.*;
import java.io.*;

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

   int n = sc.nextInt();
   long sum = 0;
   int min = 1000000;
   int max = -1000000;

   for(int i=0; i<n; i++){
       int a = sc.nextInt();
       sum += a;
       if(a < min){
           min = a;
       }
       if(a > max){
           max = a;
       }
   }

    System.out.println(min + " " + max + " " + sum);
 }
}