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

public class Main {

    public static void main(String[] args) throws IOException {

        int n = 0;      //??\??????????????????2???????????´??°?????°???
        int min = 0;    //????°????
        int max = 0;    //?????§???
        double sum = 0; //????¨????

        try{
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

            String input = br.readLine();

//          ??\??????1?????????2???????????´??°?????°??????????????????
            n = Integer.parseInt(input);

            input = br.readLine();
            String[] strArray =input.split(" ");

//          1???????????´??°???????°??????¨?????§????????£??\
            min = Integer.parseInt(strArray[0]);    //????°????
            max = min;   //?????§???
            sum += (double)min;  //????¨????

//          2????????\????????´??°
            for(int i = 1; i < n ; i++){

                int x = Integer.parseInt(strArray[i]);

//              1???????????´??°??¨????????????x????°?????????´??????min?????£??\
                if(x < min){
                    min = x;
                }
//              1???????????´??°??¨????????????x?????§????????´??????max?????£??\
                if(max < x){
                    max = x;
                }
//              ????¨???????x?????????
                sum += (double)x;
            }
            DecimalFormat DF = new DecimalFormat("0");

            System.out.println(min + " " + max + " " + DF.format(sum));

        }catch(IOException e) {

            //??????????????????
            System.out.println(e);

        }catch(NumberFormatException e) {

            //??°?????\????????\????????§??????
            System.out.println("??°?????§??\??????????????????");
        }
    }
}
/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