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

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

        int num = Integer.valueOf(br.readLine());

        String[] preValues = br.readLine().split(" " , num);
        long[] values = new long[num];

        for(int i = 0; i < num; i++){
            values[i] = Integer.parseInt(preValues[i]);
        }

        System.out.print(getMin(values) + " ");
        System.out.print(getMax(values) + " ");
        System.out.println(sum(values));

    }

    private static long getMin(long[] data){
        long min = data[0];

        for(int i = 1; i < data.length; i++){
            if(min > data[i]) min = data[i];
        }

        return min;
    }

    private static long getMax(long[] data){
        long max = data[0];

        for(int i = 1; i < data.length; i++){
            if(max < data[i]) max = data[i];
        }

        return max;
    }

    private static long sum(long[] data){
        long sum = 0;

        for(int i = 0; i < data.length; i++){
            sum += data[i];
        }

        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