import java.util.*;                                                                                  

public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);

        line = sc.nextLine();
        String[] l = line.split(" ");

        int[] a = new int[n];
        int min = Integer.parseInt(l[0]);
        int max = Integer.parseInt(l[0]);
        long sum = 0;
        for(int i = 0; i < n; i++) {
          a[i] = Integer.parseInt(l[i]);
          if(min > a[i]) {
            min = a[i];
          }   
          if(a[i] > max) {
            max = a[i];
          }   
          sum = sum + a[i];
        }   

        System.out.println(min + " " + max + " " + sum);
    }   
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);

        line = sc.nextLine();
        String[] l = line.split(" ");

        int[] a = new int[n];
        int min = Integer.parseInt(l[0]);
        int max = Integer.parseInt(l[0]);
        long sum = 0;
        for(int i = 0; i < n; i++) {
          a[i] = Integer.parseInt(l[i]);
          if(min > a[i]) {
            min = a[i];
          }   
          if(a[i] > max) {
            max = a[i];
          }   
          sum = sum + a[i];
        }   

        System.out.println(min + " " + max + " " + sum);
    }   
} Main public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);

        line = sc.nextLine();
        String[] l = line.split(" ");

        int[] a = new int[n];
        int min = Integer.parseInt(l[0]);
        int max = Integer.parseInt(l[0]);
        long sum = 0;
        for(int i = 0; i < n; i++) {
          a[i] = Integer.parseInt(l[i]);
          if(min > a[i]) {
            min = a[i];
          }   
          if(a[i] > max) {
            max = a[i];
          }   
          sum = sum + a[i];
        }   

        System.out.println(min + " " + max + " " + sum);
    } main {

        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);

        line = sc.nextLine();
        String[] l = line.split(" ");

        int[] a = new int[n];
        int min = Integer.parseInt(l[0]);
        int max = Integer.parseInt(l[0]);
        long sum = 0;
        for(int i = 0; i < n; i++) {
          a[i] = Integer.parseInt(l[i]);
          if(min > a[i]) {
            min = a[i];
          }   
          if(a[i] > max) {
            max = a[i];
          }   
          sum = sum + a[i];
        }   

        System.out.println(min + " " + max + " " + sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc int n = Integer.parseInt(line); n Integer.parseInt(line) Integer.parseInt Integer line line = sc.nextLine() line sc.nextLine() sc.nextLine sc String[] l = line.split(" "); l line.split(" ") line.split line " " int[] a = new int[n]; a new int[n] n int min = Integer.parseInt(l[0]); min Integer.parseInt(l[0]) Integer.parseInt Integer l[0] l 0 int max = Integer.parseInt(l[0]); max Integer.parseInt(l[0]) Integer.parseInt Integer l[0] l 0 long sum = 0; sum 0 for(int i = 0; i < n; i++) {
          a[i] = Integer.parseInt(l[i]);
          if(min > a[i]) {
            min = a[i];
          }   
          if(a[i] > max) {
            max = a[i];
          }   
          sum = sum + a[i];
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
          a[i] = Integer.parseInt(l[i]);
          if(min > a[i]) {
            min = a[i];
          }   
          if(a[i] > max) {
            max = a[i];
          }   
          sum = sum + a[i];
        } {
          a[i] = Integer.parseInt(l[i]);
          if(min > a[i]) {
            min = a[i];
          }   
          if(a[i] > max) {
            max = a[i];
          }   
          sum = sum + a[i];
        } a[i] = Integer.parseInt(l[i]) a[i] a i Integer.parseInt(l[i]) Integer.parseInt Integer l[i] l i if(min > a[i]) {
            min = a[i];
          } min > a[i] min a[i] a i {
            min = a[i];
          } min = a[i] min a[i] a i if(a[i] > max) {
            max = a[i];
          } a[i] > max a[i] a i max {
            max = a[i];
          } max = a[i] max a[i] a i sum = sum + a[i] sum sum + a[i] sum a[i] a i System.out.println(min + " " + max + " " + sum) System.out.println System.out System System.out min + " " + max + " " + sum " " max min + " " + max + " " + sum min " " max " " sum String[] args args public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);

        line = sc.nextLine();
        String[] l = line.split(" ");

        int[] a = new int[n];
        int min = Integer.parseInt(l[0]);
        int max = Integer.parseInt(l[0]);
        long sum = 0;
        for(int i = 0; i < n; i++) {
          a[i] = Integer.parseInt(l[i]);
          if(min > a[i]) {
            min = a[i];
          }   
          if(a[i] > max) {
            max = a[i];
          }   
          sum = sum + a[i];
        }   

        System.out.println(min + " " + max + " " + sum);
    }   
} public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);

        line = sc.nextLine();
        String[] l = line.split(" ");

        int[] a = new int[n];
        int min = Integer.parseInt(l[0]);
        int max = Integer.parseInt(l[0]);
        long sum = 0;
        for(int i = 0; i < n; i++) {
          a[i] = Integer.parseInt(l[i]);
          if(min > a[i]) {
            min = a[i];
          }   
          if(a[i] > max) {
            max = a[i];
          }   
          sum = sum + a[i];
        }   

        System.out.println(min + " " + max + " " + sum);
    }   
} Main
import java.util.*;                                                                                  

public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);

        line = sc.nextLine();
        String[] l = line.split(" ");

        int[] a = new int[n];
        int min = Integer.parseInt(l[0]);
        int max = Integer.parseInt(l[0]);
        long sum = 0;
        for(int i = 0; i < n; i++) {
          a[i] = Integer.parseInt(l[i]);
          if(min > a[i]) {
            min = a[i];
          }   
          if(a[i] > max) {
            max = a[i];
          }   
          sum = sum + a[i];
        }   

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