import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(
            new InputStreamReader(System.in));
        br.readLine();
        final String[] data = br.readLine().split(" ");
        long min = Long.parseLong(data[0]);
        long max = Long.parseLong(data[0]);
        long sum = 0;
        long num = 0;
        for (String s : data) {
            num = Long.parseLong(s);
            if (max < num) {
                max = num;
            } else if (num < min) {
                min = num;
            }
            sum += num;
        }
        System.out.println(min + " " + max + " " + sum);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(
            new InputStreamReader(System.in));
        br.readLine();
        final String[] data = br.readLine().split(" ");
        long min = Long.parseLong(data[0]);
        long max = Long.parseLong(data[0]);
        long sum = 0;
        long num = 0;
        for (String s : data) {
            num = Long.parseLong(s);
            if (max < num) {
                max = num;
            } else if (num < min) {
                min = num;
            }
            sum += num;
        }
        System.out.println(min + " " + max + " " + sum);
    }
} Main public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(
            new InputStreamReader(System.in));
        br.readLine();
        final String[] data = br.readLine().split(" ");
        long min = Long.parseLong(data[0]);
        long max = Long.parseLong(data[0]);
        long sum = 0;
        long num = 0;
        for (String s : data) {
            num = Long.parseLong(s);
            if (max < num) {
                max = num;
            } else if (num < min) {
                min = num;
            }
            sum += num;
        }
        System.out.println(min + " " + max + " " + sum);
    } main {
        BufferedReader br = new BufferedReader(
            new InputStreamReader(System.in));
        br.readLine();
        final String[] data = br.readLine().split(" ");
        long min = Long.parseLong(data[0]);
        long max = Long.parseLong(data[0]);
        long sum = 0;
        long num = 0;
        for (String s : data) {
            num = Long.parseLong(s);
            if (max < num) {
                max = num;
            } else if (num < min) {
                min = num;
            }
            sum += num;
        }
        System.out.println(min + " " + max + " " + sum);
    } BufferedReader br = new BufferedReader(
            new InputStreamReader(System.in)); br new BufferedReader(
            new InputStreamReader(System.in)) br.readLine() br.readLine br final String[] data = br.readLine().split(" "); data br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " long min = Long.parseLong(data[0]); min Long.parseLong(data[0]) Long.parseLong Long data[0] data 0 long max = Long.parseLong(data[0]); max Long.parseLong(data[0]) Long.parseLong Long data[0] data 0 long sum = 0; sum 0 long num = 0; num 0 for (String s : data) {
            num = Long.parseLong(s);
            if (max < num) {
                max = num;
            } else if (num < min) {
                min = num;
            }
            sum += num;
        } String s data {
            num = Long.parseLong(s);
            if (max < num) {
                max = num;
            } else if (num < min) {
                min = num;
            }
            sum += num;
        } {
            num = Long.parseLong(s);
            if (max < num) {
                max = num;
            } else if (num < min) {
                min = num;
            }
            sum += num;
        } num = Long.parseLong(s) num Long.parseLong(s) Long.parseLong Long s if (max < num) {
                max = num;
            } else if (num < min) {
                min = num;
            } max < num max num {
                max = num;
            } max = num max num if (num < min) {
                min = num;
            } num < min num min {
                min = num;
            } min = num min num sum += num sum num 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 public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(
            new InputStreamReader(System.in));
        br.readLine();
        final String[] data = br.readLine().split(" ");
        long min = Long.parseLong(data[0]);
        long max = Long.parseLong(data[0]);
        long sum = 0;
        long num = 0;
        for (String s : data) {
            num = Long.parseLong(s);
            if (max < num) {
                max = num;
            } else if (num < min) {
                min = num;
            }
            sum += num;
        }
        System.out.println(min + " " + max + " " + sum);
    }
} public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(
            new InputStreamReader(System.in));
        br.readLine();
        final String[] data = br.readLine().split(" ");
        long min = Long.parseLong(data[0]);
        long max = Long.parseLong(data[0]);
        long sum = 0;
        long num = 0;
        for (String s : data) {
            num = Long.parseLong(s);
            if (max < num) {
                max = num;
            } else if (num < min) {
                min = num;
            }
            sum += num;
        }
        System.out.println(min + " " + max + " " + sum);
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(
            new InputStreamReader(System.in));
        br.readLine();
        final String[] data = br.readLine().split(" ");
        long min = Long.parseLong(data[0]);
        long max = Long.parseLong(data[0]);
        long sum = 0;
        long num = 0;
        for (String s : data) {
            num = Long.parseLong(s);
            if (max < num) {
                max = num;
            } else if (num < min) {
                min = num;
            }
            sum += num;
        }
        System.out.println(min + " " + max + " " + sum);
    }
}