import java.util.Scanner;
  
class Main{
       public static void main(String[] args){
           Scanner sc = new Scanner(System.in);
           int x = sc.nextInt();
           int tmp =0;
           int[] num = new int[x];
  
           int min = 1000000;
           int max = -1000000;
           long sum = 0;
  
           for(int i=0; i<num.length; i++){
                    tmp = sc.nextInt();
                    num[i] = tmp;
           }
              
           for(int i=0; i<num.length; i++){
                    if(min > num[i]){
                       min = num[i];
                    }
           }
  
           for(int i=0; i<num.length; i++){
                    if(max < num[i]){
                       max = num[i];
                    }
           }
  
           for(int i=0; i<num.length; i++){
                    sum += num[i];
           }
            
           System.out.print(min);
           System.out.print(' ');
           System.out.print(max);
           System.out.print(' ');
           System.out.println(sum);
  
       }
} import java.util.Scanner; Scanner java.util class Main{
       public static void main(String[] args){
           Scanner sc = new Scanner(System.in);
           int x = sc.nextInt();
           int tmp =0;
           int[] num = new int[x];
  
           int min = 1000000;
           int max = -1000000;
           long sum = 0;
  
           for(int i=0; i<num.length; i++){
                    tmp = sc.nextInt();
                    num[i] = tmp;
           }
              
           for(int i=0; i<num.length; i++){
                    if(min > num[i]){
                       min = num[i];
                    }
           }
  
           for(int i=0; i<num.length; i++){
                    if(max < num[i]){
                       max = num[i];
                    }
           }
  
           for(int i=0; i<num.length; i++){
                    sum += num[i];
           }
            
           System.out.print(min);
           System.out.print(' ');
           System.out.print(max);
           System.out.print(' ');
           System.out.println(sum);
  
       }
} Main public static void main(String[] args){
           Scanner sc = new Scanner(System.in);
           int x = sc.nextInt();
           int tmp =0;
           int[] num = new int[x];
  
           int min = 1000000;
           int max = -1000000;
           long sum = 0;
  
           for(int i=0; i<num.length; i++){
                    tmp = sc.nextInt();
                    num[i] = tmp;
           }
              
           for(int i=0; i<num.length; i++){
                    if(min > num[i]){
                       min = num[i];
                    }
           }
  
           for(int i=0; i<num.length; i++){
                    if(max < num[i]){
                       max = num[i];
                    }
           }
  
           for(int i=0; i<num.length; i++){
                    sum += num[i];
           }
            
           System.out.print(min);
           System.out.print(' ');
           System.out.print(max);
           System.out.print(' ');
           System.out.println(sum);
  
       } main {
           Scanner sc = new Scanner(System.in);
           int x = sc.nextInt();
           int tmp =0;
           int[] num = new int[x];
  
           int min = 1000000;
           int max = -1000000;
           long sum = 0;
  
           for(int i=0; i<num.length; i++){
                    tmp = sc.nextInt();
                    num[i] = tmp;
           }
              
           for(int i=0; i<num.length; i++){
                    if(min > num[i]){
                       min = num[i];
                    }
           }
  
           for(int i=0; i<num.length; i++){
                    if(max < num[i]){
                       max = num[i];
                    }
           }
  
           for(int i=0; i<num.length; i++){
                    sum += num[i];
           }
            
           System.out.print(min);
           System.out.print(' ');
           System.out.print(max);
           System.out.print(' ');
           System.out.println(sum);
  
       } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int x = sc.nextInt(); x sc.nextInt() sc.nextInt sc int tmp =0; tmp 0 int[] num = new int[x]; num new int[x] x int min = 1000000; min 1000000 int max = -1000000; max -1000000 1000000 long sum = 0; sum 0 for(int i=0; i<num.length; i++){
                    tmp = sc.nextInt();
                    num[i] = tmp;
           } int i=0; int i=0; i 0 i<num.length i num.length num num.length i++ i++ i {
                    tmp = sc.nextInt();
                    num[i] = tmp;
           } {
                    tmp = sc.nextInt();
                    num[i] = tmp;
           } tmp = sc.nextInt() tmp sc.nextInt() sc.nextInt sc num[i] = tmp num[i] num i tmp for(int i=0; i<num.length; i++){
                    if(min > num[i]){
                       min = num[i];
                    }
           } int i=0; int i=0; i 0 i<num.length i num.length num num.length i++ i++ i {
                    if(min > num[i]){
                       min = num[i];
                    }
           } {
                    if(min > num[i]){
                       min = num[i];
                    }
           } if(min > num[i]){
                       min = num[i];
                    } min > num[i] min num[i] num i {
                       min = num[i];
                    } min = num[i] min num[i] num i for(int i=0; i<num.length; i++){
                    if(max < num[i]){
                       max = num[i];
                    }
           } int i=0; int i=0; i 0 i<num.length i num.length num num.length i++ i++ i {
                    if(max < num[i]){
                       max = num[i];
                    }
           } {
                    if(max < num[i]){
                       max = num[i];
                    }
           } if(max < num[i]){
                       max = num[i];
                    } max < num[i] max num[i] num i {
                       max = num[i];
                    } max = num[i] max num[i] num i for(int i=0; i<num.length; i++){
                    sum += num[i];
           } int i=0; int i=0; i 0 i<num.length i num.length num num.length i++ i++ i {
                    sum += num[i];
           } {
                    sum += num[i];
           } sum += num[i] sum num[i] num i System.out.print(min) System.out.print System.out System System.out min System.out.print(' ') System.out.print System.out System System.out ' ' System.out.print(max) System.out.print System.out System System.out max System.out.print(' ') System.out.print System.out System System.out ' ' System.out.println(sum) System.out.println System.out System System.out sum String[] args args
import java.util.Scanner;
  
class Main{
       public static void main(String[] args){
           Scanner sc = new Scanner(System.in);
           int x = sc.nextInt();
           int tmp =0;
           int[] num = new int[x];
  
           int min = 1000000;
           int max = -1000000;
           long sum = 0;
  
           for(int i=0; i<num.length; i++){
                    tmp = sc.nextInt();
                    num[i] = tmp;
           }
              
           for(int i=0; i<num.length; i++){
                    if(min > num[i]){
                       min = num[i];
                    }
           }
  
           for(int i=0; i<num.length; i++){
                    if(max < num[i]){
                       max = num[i];
                    }
           }
  
           for(int i=0; i<num.length; i++){
                    sum += num[i];
           }
            
           System.out.print(min);
           System.out.print(' ');
           System.out.print(max);
           System.out.print(' ');
           System.out.println(sum);
  
       }
}
