import java.util.NoSuchElementException;
import java.util.Scanner;

public class Main {
    private static int MIN = -1000000;
    private static int MAX = 1000000;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        try {
            int n = Integer.parseInt(sc.nextLine());
            int min = MAX;
            int max = MIN;
            double total = 0;
            while (sc.hasNext()) {
                int a = sc.nextInt();
                max = Integer.max(a, max);
                min = Integer.min(a, min);
                total += a;
            }
            System.out.printf("%d %d %.0f\n", min, max, total);
        } catch (NoSuchElementException
                | NumberFormatException e) {
            System.out.println(e);
        }
    }
}
 import java.util.NoSuchElementException; NoSuchElementException java.util import java.util.Scanner; Scanner java.util public class Main {
    private static int MIN = -1000000;
    private static int MAX = 1000000;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        try {
            int n = Integer.parseInt(sc.nextLine());
            int min = MAX;
            int max = MIN;
            double total = 0;
            while (sc.hasNext()) {
                int a = sc.nextInt();
                max = Integer.max(a, max);
                min = Integer.min(a, min);
                total += a;
            }
            System.out.printf("%d %d %.0f\n", min, max, total);
        } catch (NoSuchElementException
                | NumberFormatException e) {
            System.out.println(e);
        }
    }
} Main private static int MIN = -1000000; MIN -1000000 1000000 private static int MAX = 1000000; MAX 1000000 public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        try {
            int n = Integer.parseInt(sc.nextLine());
            int min = MAX;
            int max = MIN;
            double total = 0;
            while (sc.hasNext()) {
                int a = sc.nextInt();
                max = Integer.max(a, max);
                min = Integer.min(a, min);
                total += a;
            }
            System.out.printf("%d %d %.0f\n", min, max, total);
        } catch (NoSuchElementException
                | NumberFormatException e) {
            System.out.println(e);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        try {
            int n = Integer.parseInt(sc.nextLine());
            int min = MAX;
            int max = MIN;
            double total = 0;
            while (sc.hasNext()) {
                int a = sc.nextInt();
                max = Integer.max(a, max);
                min = Integer.min(a, min);
                total += a;
            }
            System.out.printf("%d %d %.0f\n", min, max, total);
        } catch (NoSuchElementException
                | NumberFormatException e) {
            System.out.println(e);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) try {
            int n = Integer.parseInt(sc.nextLine());
            int min = MAX;
            int max = MIN;
            double total = 0;
            while (sc.hasNext()) {
                int a = sc.nextInt();
                max = Integer.max(a, max);
                min = Integer.min(a, min);
                total += a;
            }
            System.out.printf("%d %d %.0f\n", min, max, total);
        } catch (NoSuchElementException
                | NumberFormatException e) {
            System.out.println(e);
        } catch (NoSuchElementException
                | NumberFormatException e) {
            System.out.println(e);
        } NoSuchElementException
                | NumberFormatException e {
            System.out.println(e);
        } System.out.println(e) System.out.println System.out System System.out e {
            int n = Integer.parseInt(sc.nextLine());
            int min = MAX;
            int max = MIN;
            double total = 0;
            while (sc.hasNext()) {
                int a = sc.nextInt();
                max = Integer.max(a, max);
                min = Integer.min(a, min);
                total += a;
            }
            System.out.printf("%d %d %.0f\n", min, max, total);
        } int n = Integer.parseInt(sc.nextLine()); n Integer.parseInt(sc.nextLine()) Integer.parseInt Integer sc.nextLine() sc.nextLine sc int min = MAX; min MAX int max = MIN; max MIN double total = 0; total 0 while (sc.hasNext()) {
                int a = sc.nextInt();
                max = Integer.max(a, max);
                min = Integer.min(a, min);
                total += a;
            } sc.hasNext() sc.hasNext sc {
                int a = sc.nextInt();
                max = Integer.max(a, max);
                min = Integer.min(a, min);
                total += a;
            } int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc max = Integer.max(a, max) max Integer.max(a, max) Integer.max Integer a max min = Integer.min(a, min) min Integer.min(a, min) Integer.min Integer a min total += a total a System.out.printf("%d %d %.0f\n", min, max, total) System.out.printf System.out System System.out "%d %d %.0f\n" min max total String[] args args public class Main {
    private static int MIN = -1000000;
    private static int MAX = 1000000;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        try {
            int n = Integer.parseInt(sc.nextLine());
            int min = MAX;
            int max = MIN;
            double total = 0;
            while (sc.hasNext()) {
                int a = sc.nextInt();
                max = Integer.max(a, max);
                min = Integer.min(a, min);
                total += a;
            }
            System.out.printf("%d %d %.0f\n", min, max, total);
        } catch (NoSuchElementException
                | NumberFormatException e) {
            System.out.println(e);
        }
    }
} public class Main {
    private static int MIN = -1000000;
    private static int MAX = 1000000;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        try {
            int n = Integer.parseInt(sc.nextLine());
            int min = MAX;
            int max = MIN;
            double total = 0;
            while (sc.hasNext()) {
                int a = sc.nextInt();
                max = Integer.max(a, max);
                min = Integer.min(a, min);
                total += a;
            }
            System.out.printf("%d %d %.0f\n", min, max, total);
        } catch (NoSuchElementException
                | NumberFormatException e) {
            System.out.println(e);
        }
    }
} Main
import java.util.NoSuchElementException;
import java.util.Scanner;

public class Main {
    private static int MIN = -1000000;
    private static int MAX = 1000000;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        try {
            int n = Integer.parseInt(sc.nextLine());
            int min = MAX;
            int max = MIN;
            double total = 0;
            while (sc.hasNext()) {
                int a = sc.nextInt();
                max = Integer.max(a, max);
                min = Integer.min(a, min);
                total += a;
            }
            System.out.printf("%d %d %.0f\n", min, max, total);
        } catch (NoSuchElementException
                | NumberFormatException e) {
            System.out.println(e);
        }
    }
}

