import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int min = Integer.MAX_VALUE;
        int max = Integer.MIN_VALUE;
        long sum = 0;
        
        List<Integer> array = new ArrayList<Integer>();
        while (scan.hasNext()) {
             int i = scan.nextInt();
             array.add(i);
        }
        
        for(int j=0; j<array.size(); j++) {
            if(min > array.get(j)) min = array.get(j);
            if(max < array.get(j)) max = array.get(j);
            sum += array.get(j);
       }
       
       System.out.println(min +" "+ max +" "+ sum);
       scan.close();
    }
} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int min = Integer.MAX_VALUE;
        int max = Integer.MIN_VALUE;
        long sum = 0;
        
        List<Integer> array = new ArrayList<Integer>();
        while (scan.hasNext()) {
             int i = scan.nextInt();
             array.add(i);
        }
        
        for(int j=0; j<array.size(); j++) {
            if(min > array.get(j)) min = array.get(j);
            if(max < array.get(j)) max = array.get(j);
            sum += array.get(j);
       }
       
       System.out.println(min +" "+ max +" "+ sum);
       scan.close();
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int min = Integer.MAX_VALUE;
        int max = Integer.MIN_VALUE;
        long sum = 0;
        
        List<Integer> array = new ArrayList<Integer>();
        while (scan.hasNext()) {
             int i = scan.nextInt();
             array.add(i);
        }
        
        for(int j=0; j<array.size(); j++) {
            if(min > array.get(j)) min = array.get(j);
            if(max < array.get(j)) max = array.get(j);
            sum += array.get(j);
       }
       
       System.out.println(min +" "+ max +" "+ sum);
       scan.close();
    } main {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int min = Integer.MAX_VALUE;
        int max = Integer.MIN_VALUE;
        long sum = 0;
        
        List<Integer> array = new ArrayList<Integer>();
        while (scan.hasNext()) {
             int i = scan.nextInt();
             array.add(i);
        }
        
        for(int j=0; j<array.size(); j++) {
            if(min > array.get(j)) min = array.get(j);
            if(max < array.get(j)) max = array.get(j);
            sum += array.get(j);
       }
       
       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 int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE int max = Integer.MIN_VALUE; max Integer.MIN_VALUE Integer Integer.MIN_VALUE long sum = 0; sum 0 List<Integer> array = new ArrayList<Integer>(); array new ArrayList<Integer>() while (scan.hasNext()) {
             int i = scan.nextInt();
             array.add(i);
        } scan.hasNext() scan.hasNext scan {
             int i = scan.nextInt();
             array.add(i);
        } int i = scan.nextInt(); i scan.nextInt() scan.nextInt scan array.add(i) array.add array i for(int j=0; j<array.size(); j++) {
            if(min > array.get(j)) min = array.get(j);
            if(max < array.get(j)) max = array.get(j);
            sum += array.get(j);
       } int j=0; int j=0; j 0 j<array.size() j array.size() array.size array j++ j++ j {
            if(min > array.get(j)) min = array.get(j);
            if(max < array.get(j)) max = array.get(j);
            sum += array.get(j);
       } {
            if(min > array.get(j)) min = array.get(j);
            if(max < array.get(j)) max = array.get(j);
            sum += array.get(j);
       } if(min > array.get(j)) min = array.get(j); min > array.get(j) min array.get(j) array.get array j min = array.get(j) min array.get(j) array.get array j if(max < array.get(j)) max = array.get(j); max < array.get(j) max array.get(j) array.get array j max = array.get(j) max array.get(j) array.get array j sum += array.get(j) sum array.get(j) array.get array j 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
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int min = Integer.MAX_VALUE;
        int max = Integer.MIN_VALUE;
        long sum = 0;
        
        List<Integer> array = new ArrayList<Integer>();
        while (scan.hasNext()) {
             int i = scan.nextInt();
             array.add(i);
        }
        
        for(int j=0; j<array.size(); j++) {
            if(min > array.get(j)) min = array.get(j);
            if(max < array.get(j)) max = array.get(j);
            sum += array.get(j);
       }
       
       System.out.println(min +" "+ max +" "+ sum);
       scan.close();
    }
}