import java.io.*;
import java.util.ArrayList;
import java.util.Collections;
 
public class Main {
 
    public static void main(String[] args) throws IOException {
 
        int x = 0;
        long sum = 0;
        ArrayList<Integer> num = new ArrayList<>();
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         
        for(int i = 0; i < 2; i++) {
            if(i == 0){
                String[] line = br.readLine().split(" ");
                x = Integer.parseInt(line[0]);
            }
             
            else{
                String[] line = br.readLine().split(" ");
                for(int a = 0; a < x; a++){
                    sum = sum + Integer.parseInt(line[a]);
                    num.add(Integer.parseInt(line[a]));
                }
            }
             
        }
         
        System.out.println(Collections.min(num) +" "+ Collections.max(num) +" "+ 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