
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main (String[] args) throws IOException {
        int c;
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder builder = new StringBuilder();        

        String data = reader.readLine();
        c = Integer.parseInt(data);
        int[] array = new int[c];

        data = reader.readLine();
        String[] number = data.split(" ");
        for (int i = 0; i < c ; i++ ) {
            array[i] = Integer.parseInt(number[i]);
        }
        int max = Max(array);
        int min = Min(array);
        long sum = Sum(array);
        builder
           .append(min)
           .append(" ")
           .append(max)
           .append(" ")
           .append(sum);
        System.out.println(builder);
        
    }
    public static int Max (int[] array){
        int i;
        int max = array[0];
        for (i = 0; i < array.length-1 ; i++ ) {
            if ( max < array[i+1])
                max = array[i+1];
        }
        return max;
    }
    public static int Min (int[] array){
        int i;
        int min = array[0];
        for (i = 0; i < array.length-1 ; i++ ) {
            if ( min > array[i+1])
                min = array[i+1];
        }
        return min;
    }
    public static long Sum (int[] array){
        int i;
        long sum = array[0];
        for (i = 0; i < array.length-1 ; i++ ) {
                sum += array[i+1];
        }
        return sum;
    }
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz