import java.util.Scanner;

class Main{
    private static final Scanner sc = new Scanner(System.in);
    public static void main(String[] Args){
        final int n = Integer.parseInt(sc.next());
        long sum = 0;
        int min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;
        for(int i = 0; i<n; i++){
            final int a = Integer.parseInt(sc.next());
            max = Math.max(max, a);
            min = Math.min(min, a);
            sum += a;
        }
        System.out.println(min+" "+max+" "+sum);
    }
} import java.util.Scanner; Scanner java.util class Main{
    private static final Scanner sc = new Scanner(System.in);
    public static void main(String[] Args){
        final int n = Integer.parseInt(sc.next());
        long sum = 0;
        int min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;
        for(int i = 0; i<n; i++){
            final int a = Integer.parseInt(sc.next());
            max = Math.max(max, a);
            min = Math.min(min, a);
            sum += a;
        }
        System.out.println(min+" "+max+" "+sum);
    }
} Main private static final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] Args){
        final int n = Integer.parseInt(sc.next());
        long sum = 0;
        int min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;
        for(int i = 0; i<n; i++){
            final int a = Integer.parseInt(sc.next());
            max = Math.max(max, a);
            min = Math.min(min, a);
            sum += a;
        }
        System.out.println(min+" "+max+" "+sum);
    } main {
        final int n = Integer.parseInt(sc.next());
        long sum = 0;
        int min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;
        for(int i = 0; i<n; i++){
            final int a = Integer.parseInt(sc.next());
            max = Math.max(max, a);
            min = Math.min(min, a);
            sum += a;
        }
        System.out.println(min+" "+max+" "+sum);
    } final int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc long sum = 0; sum 0 int min = Integer.MAX_VALUE min Integer.MAX_VALUE Integer Integer.MAX_VALUE max = Integer.MIN_VALUE; max Integer.MIN_VALUE Integer Integer.MIN_VALUE for(int i = 0; i<n; i++){
            final int a = Integer.parseInt(sc.next());
            max = Math.max(max, a);
            min = Math.min(min, a);
            sum += a;
        } int i = 0; int i = 0; i 0 i<n i n i++ i++ i {
            final int a = Integer.parseInt(sc.next());
            max = Math.max(max, a);
            min = Math.min(min, a);
            sum += a;
        } {
            final int a = Integer.parseInt(sc.next());
            max = Math.max(max, a);
            min = Math.min(min, a);
            sum += a;
        } final int a = Integer.parseInt(sc.next()); a Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc max = Math.max(max, a) max Math.max(max, a) Math.max Math max a min = Math.min(min, a) min Math.min(min, a) Math.min Math min a sum += a sum a 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
import java.util.Scanner;

class Main{
    private static final Scanner sc = new Scanner(System.in);
    public static void main(String[] Args){
        final int n = Integer.parseInt(sc.next());
        long sum = 0;
        int min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;
        for(int i = 0; i<n; i++){
            final int a = Integer.parseInt(sc.next());
            max = Math.max(max, a);
            min = Math.min(min, a);
            sum += a;
        }
        System.out.println(min+" "+max+" "+sum);
    }
}