import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        long N = sc.nextLong();

        long min = Long.MAX_VALUE;
        long max = Long.MIN_VALUE;
        long sum = 0;
        for (long i = 0; i < N; i++) {
            long a = sc.nextLong();

            sum += a;

            if (min > a) {
                min = a;
            }
            if (max < a) {
                max = a;
            }
        }

        System.out.printf("%d %d %d\n", min ,max, sum);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        long N = sc.nextLong();

        long min = Long.MAX_VALUE;
        long max = Long.MIN_VALUE;
        long sum = 0;
        for (long i = 0; i < N; i++) {
            long a = sc.nextLong();

            sum += a;

            if (min > a) {
                min = a;
            }
            if (max < a) {
                max = a;
            }
        }

        System.out.printf("%d %d %d\n", min ,max, sum);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        long N = sc.nextLong();

        long min = Long.MAX_VALUE;
        long max = Long.MIN_VALUE;
        long sum = 0;
        for (long i = 0; i < N; i++) {
            long a = sc.nextLong();

            sum += a;

            if (min > a) {
                min = a;
            }
            if (max < a) {
                max = a;
            }
        }

        System.out.printf("%d %d %d\n", min ,max, sum);
    } main {
        Scanner sc = new Scanner(System.in);

        long N = sc.nextLong();

        long min = Long.MAX_VALUE;
        long max = Long.MIN_VALUE;
        long sum = 0;
        for (long i = 0; i < N; i++) {
            long a = sc.nextLong();

            sum += a;

            if (min > a) {
                min = a;
            }
            if (max < a) {
                max = a;
            }
        }

        System.out.printf("%d %d %d\n", min ,max, sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N = sc.nextLong(); N sc.nextLong() sc.nextLong sc long min = Long.MAX_VALUE; min Long.MAX_VALUE Long Long.MAX_VALUE long max = Long.MIN_VALUE; max Long.MIN_VALUE Long Long.MIN_VALUE long sum = 0; sum 0 for (long i = 0; i < N; i++) {
            long a = sc.nextLong();

            sum += a;

            if (min > a) {
                min = a;
            }
            if (max < a) {
                max = a;
            }
        } long i = 0; long i = 0; i 0 i < N i N i++ i++ i {
            long a = sc.nextLong();

            sum += a;

            if (min > a) {
                min = a;
            }
            if (max < a) {
                max = a;
            }
        } {
            long a = sc.nextLong();

            sum += a;

            if (min > a) {
                min = a;
            }
            if (max < a) {
                max = a;
            }
        } long a = sc.nextLong(); a sc.nextLong() sc.nextLong sc sum += a sum a if (min > a) {
                min = a;
            } min > a min a {
                min = a;
            } min = a min a if (max < a) {
                max = a;
            } max < a max a {
                max = a;
            } max = a max a System.out.printf("%d %d %d\n", min ,max, sum) System.out.printf System.out System System.out "%d %d %d\n" min max sum String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        long N = sc.nextLong();

        long min = Long.MAX_VALUE;
        long max = Long.MIN_VALUE;
        long sum = 0;
        for (long i = 0; i < N; i++) {
            long a = sc.nextLong();

            sum += a;

            if (min > a) {
                min = a;
            }
            if (max < a) {
                max = a;
            }
        }

        System.out.printf("%d %d %d\n", min ,max, sum);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        long N = sc.nextLong();

        long min = Long.MAX_VALUE;
        long max = Long.MIN_VALUE;
        long sum = 0;
        for (long i = 0; i < N; i++) {
            long a = sc.nextLong();

            sum += a;

            if (min > a) {
                min = a;
            }
            if (max < a) {
                max = a;
            }
        }

        System.out.printf("%d %d %d\n", min ,max, sum);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        long N = sc.nextLong();

        long min = Long.MAX_VALUE;
        long max = Long.MIN_VALUE;
        long sum = 0;
        for (long i = 0; i < N; i++) {
            long a = sc.nextLong();

            sum += a;

            if (min > a) {
                min = a;
            }
            if (max < a) {
                max = a;
            }
        }

        System.out.printf("%d %d %d\n", min ,max, sum);
    }
}