import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            solve(in);
        }
    }

    private static void solve(Scanner in) {
        int n = in.nextInt();
        int min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;
        long sum = 0;
        while (n-- > 0) {
            int x = in.nextInt();
            min = min < x ? min : x;
            max = max > x ? max : x;
            sum += x;
        }
        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) {
        try (Scanner in = new Scanner(System.in)) {
            solve(in);
        }
    }

    private static void solve(Scanner in) {
        int n = in.nextInt();
        int min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;
        long sum = 0;
        while (n-- > 0) {
            int x = in.nextInt();
            min = min < x ? min : x;
            max = max > x ? max : x;
            sum += x;
        }
        System.out.printf("%d %d %d\n", min, max, sum);
    }
} Main public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            solve(in);
        }
    } main {
        try (Scanner in = new Scanner(System.in)) {
            solve(in);
        }
    } try (Scanner in = new Scanner(System.in)) {
            solve(in);
        } {
            solve(in);
        } Scanner in = new Scanner(System.in) Scanner in = new Scanner(System.in) new Scanner(System.in) solve(in) solve in String[] args args private static void solve(Scanner in) {
        int n = in.nextInt();
        int min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;
        long sum = 0;
        while (n-- > 0) {
            int x = in.nextInt();
            min = min < x ? min : x;
            max = max > x ? max : x;
            sum += x;
        }
        System.out.printf("%d %d %d\n", min, max, sum);
    } solve {
        int n = in.nextInt();
        int min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;
        long sum = 0;
        while (n-- > 0) {
            int x = in.nextInt();
            min = min < x ? min : x;
            max = max > x ? max : x;
            sum += x;
        }
        System.out.printf("%d %d %d\n", min, max, sum);
    } int n = in.nextInt(); n in.nextInt() in.nextInt in 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 long sum = 0; sum 0 while (n-- > 0) {
            int x = in.nextInt();
            min = min < x ? min : x;
            max = max > x ? max : x;
            sum += x;
        } n-- > 0 n-- n 0 {
            int x = in.nextInt();
            min = min < x ? min : x;
            max = max > x ? max : x;
            sum += x;
        } int x = in.nextInt(); x in.nextInt() in.nextInt in min = min < x ? min : x min min < x ? min : x min < x min x min x max = max > x ? max : x max max > x ? max : x max > x max x max x sum += x sum x 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 Scanner in in public class Main {

    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            solve(in);
        }
    }

    private static void solve(Scanner in) {
        int n = in.nextInt();
        int min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;
        long sum = 0;
        while (n-- > 0) {
            int x = in.nextInt();
            min = min < x ? min : x;
            max = max > x ? max : x;
            sum += x;
        }
        System.out.printf("%d %d %d\n", min, max, sum);
    }
} public class Main {

    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            solve(in);
        }
    }

    private static void solve(Scanner in) {
        int n = in.nextInt();
        int min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;
        long sum = 0;
        while (n-- > 0) {
            int x = in.nextInt();
            min = min < x ? min : x;
            max = max > x ? max : x;
            sum += x;
        }
        System.out.printf("%d %d %d\n", min, max, sum);
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            solve(in);
        }
    }

    private static void solve(Scanner in) {
        int n = in.nextInt();
        int min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;
        long sum = 0;
        while (n-- > 0) {
            int x = in.nextInt();
            min = min < x ? min : x;
            max = max > x ? max : x;
            sum += x;
        }
        System.out.printf("%d %d %d\n", min, max, sum);
    }
}