import java.util.*;

public class Main {
    private static final int MIN = -1000001;
    private static final int MAX = 1000001;
    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        int d = scn.nextInt(), n = MAX, x = MIN;
        long s = 0;
        for(int i = 0; i < d; i++) {
            int a = scn.nextInt();
            if(a < n) {
                n = a;
            }
            if(a > x) {
                x = a;
            }
            s += a;
        }
        System.out.println(n + " " + x + " " + s);
    }
} import java.util.*; util.* java public class Main {
    private static final int MIN = -1000001;
    private static final int MAX = 1000001;
    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        int d = scn.nextInt(), n = MAX, x = MIN;
        long s = 0;
        for(int i = 0; i < d; i++) {
            int a = scn.nextInt();
            if(a < n) {
                n = a;
            }
            if(a > x) {
                x = a;
            }
            s += a;
        }
        System.out.println(n + " " + x + " " + s);
    }
} Main private static final int MIN = -1000001; MIN -1000001 1000001 private static final int MAX = 1000001; MAX 1000001 public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        int d = scn.nextInt(), n = MAX, x = MIN;
        long s = 0;
        for(int i = 0; i < d; i++) {
            int a = scn.nextInt();
            if(a < n) {
                n = a;
            }
            if(a > x) {
                x = a;
            }
            s += a;
        }
        System.out.println(n + " " + x + " " + s);
    } main {
        Scanner scn = new Scanner(System.in);
        int d = scn.nextInt(), n = MAX, x = MIN;
        long s = 0;
        for(int i = 0; i < d; i++) {
            int a = scn.nextInt();
            if(a < n) {
                n = a;
            }
            if(a > x) {
                x = a;
            }
            s += a;
        }
        System.out.println(n + " " + x + " " + s);
    } Scanner scn = new Scanner(System.in); scn new Scanner(System.in) int d = scn.nextInt() d scn.nextInt() scn.nextInt scn n = MAX n MAX x = MIN; x MIN long s = 0; s 0 for(int i = 0; i < d; i++) {
            int a = scn.nextInt();
            if(a < n) {
                n = a;
            }
            if(a > x) {
                x = a;
            }
            s += a;
        } int i = 0; int i = 0; i 0 i < d i d i++ i++ i {
            int a = scn.nextInt();
            if(a < n) {
                n = a;
            }
            if(a > x) {
                x = a;
            }
            s += a;
        } {
            int a = scn.nextInt();
            if(a < n) {
                n = a;
            }
            if(a > x) {
                x = a;
            }
            s += a;
        } int a = scn.nextInt(); a scn.nextInt() scn.nextInt scn if(a < n) {
                n = a;
            } a < n a n {
                n = a;
            } n = a n a if(a > x) {
                x = a;
            } a > x a x {
                x = a;
            } x = a x a s += a s a System.out.println(n + " " + x + " " + s) System.out.println System.out System System.out n + " " + x + " " + s " " x n + " " + x + " " + s n " " x " " s String[] args args public class Main {
    private static final int MIN = -1000001;
    private static final int MAX = 1000001;
    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        int d = scn.nextInt(), n = MAX, x = MIN;
        long s = 0;
        for(int i = 0; i < d; i++) {
            int a = scn.nextInt();
            if(a < n) {
                n = a;
            }
            if(a > x) {
                x = a;
            }
            s += a;
        }
        System.out.println(n + " " + x + " " + s);
    }
} public class Main {
    private static final int MIN = -1000001;
    private static final int MAX = 1000001;
    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        int d = scn.nextInt(), n = MAX, x = MIN;
        long s = 0;
        for(int i = 0; i < d; i++) {
            int a = scn.nextInt();
            if(a < n) {
                n = a;
            }
            if(a > x) {
                x = a;
            }
            s += a;
        }
        System.out.println(n + " " + x + " " + s);
    }
} Main
import java.util.*;

public class Main {
    private static final int MIN = -1000001;
    private static final int MAX = 1000001;
    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        int d = scn.nextInt(), n = MAX, x = MIN;
        long s = 0;
        for(int i = 0; i < d; i++) {
            int a = scn.nextInt();
            if(a < n) {
                n = a;
            }
            if(a > x) {
                x = a;
            }
            s += a;
        }
        System.out.println(n + " " + x + " " + s);
    }
}