import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
 import java.util.Scanner;

class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        ArrayList<Long> array = new ArrayList<Long>();
        
       
        for(int i=0;i<n;i++){
            array.add(toLong(scan.nextInt()));
        }
        
        long min=1000001;
        long max=-1000001;
        long sum = 0;
        
        for(long i : array){
            if(min > i) min = i;
            if(max < i) max = i;
            sum += i;
        }
        
        System.out.println(min + " " + max + " " + sum);
        scan.close();
    }
    
    public static long toLong(Number number){
        return number.longValue();
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.logging.Logger; Logger java.util.logging 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();
        ArrayList<Long> array = new ArrayList<Long>();
        
       
        for(int i=0;i<n;i++){
            array.add(toLong(scan.nextInt()));
        }
        
        long min=1000001;
        long max=-1000001;
        long sum = 0;
        
        for(long i : array){
            if(min > i) min = i;
            if(max < i) max = i;
            sum += i;
        }
        
        System.out.println(min + " " + max + " " + sum);
        scan.close();
    }
    
    public static long toLong(Number number){
        return number.longValue();
    }
} Main public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        ArrayList<Long> array = new ArrayList<Long>();
        
       
        for(int i=0;i<n;i++){
            array.add(toLong(scan.nextInt()));
        }
        
        long min=1000001;
        long max=-1000001;
        long sum = 0;
        
        for(long i : array){
            if(min > i) min = i;
            if(max < i) max = i;
            sum += i;
        }
        
        System.out.println(min + " " + max + " " + sum);
        scan.close();
    } main {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        ArrayList<Long> array = new ArrayList<Long>();
        
       
        for(int i=0;i<n;i++){
            array.add(toLong(scan.nextInt()));
        }
        
        long min=1000001;
        long max=-1000001;
        long sum = 0;
        
        for(long i : array){
            if(min > i) min = i;
            if(max < i) max = i;
            sum += i;
        }
        
        System.out.println(min + " " + max + " " + sum);
        scan.close();
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan ArrayList<Long> array = new ArrayList<Long>(); array new ArrayList<Long>() for(int i=0;i<n;i++){
            array.add(toLong(scan.nextInt()));
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            array.add(toLong(scan.nextInt()));
        } {
            array.add(toLong(scan.nextInt()));
        } array.add(toLong(scan.nextInt())) array.add array toLong(scan.nextInt()) toLong scan.nextInt() scan.nextInt scan long min=1000001; min 1000001 long max=-1000001; max -1000001 1000001 long sum = 0; sum 0 for(long i : array){
            if(min > i) min = i;
            if(max < i) max = i;
            sum += i;
        } long i array {
            if(min > i) min = i;
            if(max < i) max = i;
            sum += i;
        } {
            if(min > i) min = i;
            if(max < i) max = i;
            sum += i;
        } if(min > i) min = i; min > i min i min = i min i if(max < i) max = i; max < i max i max = i max i sum += i sum i System.out.println(min + " " + max + " " + sum) System.out.println System.out System System.out min + " " + max + " " + sum " " max min + " " + max + " " + sum min " " max " " sum scan.close() scan.close scan String[] args args public static long toLong(Number number){
        return number.longValue();
    } toLong {
        return number.longValue();
    } return number.longValue(); number.longValue() number.longValue number Number number number
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
 import java.util.Scanner;

class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        ArrayList<Long> array = new ArrayList<Long>();
        
       
        for(int i=0;i<n;i++){
            array.add(toLong(scan.nextInt()));
        }
        
        long min=1000001;
        long max=-1000001;
        long sum = 0;
        
        for(long i : array){
            if(min > i) min = i;
            if(max < i) max = i;
            sum += i;
        }
        
        System.out.println(min + " " + max + " " + sum);
        scan.close();
    }
    
    public static long toLong(Number number){
        return number.longValue();
    }
}