import java.io.*;

class Main {
    private static int num;
    private static int[] data;

    public static void main(String[] args) {
        dataSet();

        long min = arrayMin(data);
        long max = arrayMax(data);
        long sum = arraySum(data);

        System.out.println(min + " " + max + " " + sum);
    }

    static void dataSet() {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

        try {
            String numString = reader.readLine();
            String[] dataString = reader.readLine().split(" ");

            num = Integer.parseInt(numString);

            data = new int[num];
            for (int i = 0; i < num; i++) {
                data[i] = Integer.parseInt(dataString[i]);
            }
        } catch (NumberFormatException e) {
            System.out.println(e);
        } catch (IOException e) {
            System.out.println(e);
        }
    }

    static long arrayMin(int[] data) {
        long min = Long.MAX_VALUE;
        for (int i = 0; i < data.length; i++) {
            min = Math.min(min, data[i]);
        }
        return min;
    }

    static long arrayMax(int[] data) {
        long max = Long.MIN_VALUE;
        for (int i = 0; i < data.length; i++) {
            max = Math.max(max, data[i]);
        }
        return max;
    }

    static long arraySum(int[] data) {
        long sum = 0;
        for (int i = 0; i < num; i++) {
            sum += data[i];
        }
        return sum;
    }
} import java.io.*; io.* java class Main {
    private static int num;
    private static int[] data;

    public static void main(String[] args) {
        dataSet();

        long min = arrayMin(data);
        long max = arrayMax(data);
        long sum = arraySum(data);

        System.out.println(min + " " + max + " " + sum);
    }

    static void dataSet() {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

        try {
            String numString = reader.readLine();
            String[] dataString = reader.readLine().split(" ");

            num = Integer.parseInt(numString);

            data = new int[num];
            for (int i = 0; i < num; i++) {
                data[i] = Integer.parseInt(dataString[i]);
            }
        } catch (NumberFormatException e) {
            System.out.println(e);
        } catch (IOException e) {
            System.out.println(e);
        }
    }

    static long arrayMin(int[] data) {
        long min = Long.MAX_VALUE;
        for (int i = 0; i < data.length; i++) {
            min = Math.min(min, data[i]);
        }
        return min;
    }

    static long arrayMax(int[] data) {
        long max = Long.MIN_VALUE;
        for (int i = 0; i < data.length; i++) {
            max = Math.max(max, data[i]);
        }
        return max;
    }

    static long arraySum(int[] data) {
        long sum = 0;
        for (int i = 0; i < num; i++) {
            sum += data[i];
        }
        return sum;
    }
} Main private static int num; num private static int[] data; data public static void main(String[] args) {
        dataSet();

        long min = arrayMin(data);
        long max = arrayMax(data);
        long sum = arraySum(data);

        System.out.println(min + " " + max + " " + sum);
    } main {
        dataSet();

        long min = arrayMin(data);
        long max = arrayMax(data);
        long sum = arraySum(data);

        System.out.println(min + " " + max + " " + sum);
    } dataSet() dataSet long min = arrayMin(data); min arrayMin(data) arrayMin data long max = arrayMax(data); max arrayMax(data) arrayMax data long sum = arraySum(data); sum arraySum(data) arraySum data 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 static void dataSet() {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

        try {
            String numString = reader.readLine();
            String[] dataString = reader.readLine().split(" ");

            num = Integer.parseInt(numString);

            data = new int[num];
            for (int i = 0; i < num; i++) {
                data[i] = Integer.parseInt(dataString[i]);
            }
        } catch (NumberFormatException e) {
            System.out.println(e);
        } catch (IOException e) {
            System.out.println(e);
        }
    } dataSet {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

        try {
            String numString = reader.readLine();
            String[] dataString = reader.readLine().split(" ");

            num = Integer.parseInt(numString);

            data = new int[num];
            for (int i = 0; i < num; i++) {
                data[i] = Integer.parseInt(dataString[i]);
            }
        } catch (NumberFormatException e) {
            System.out.println(e);
        } catch (IOException e) {
            System.out.println(e);
        }
    } BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) try {
            String numString = reader.readLine();
            String[] dataString = reader.readLine().split(" ");

            num = Integer.parseInt(numString);

            data = new int[num];
            for (int i = 0; i < num; i++) {
                data[i] = Integer.parseInt(dataString[i]);
            }
        } catch (NumberFormatException e) {
            System.out.println(e);
        } catch (IOException e) {
            System.out.println(e);
        } catch (NumberFormatException e) {
            System.out.println(e);
        } NumberFormatException e {
            System.out.println(e);
        } System.out.println(e) System.out.println System.out System System.out e catch (IOException e) {
            System.out.println(e);
        } IOException e {
            System.out.println(e);
        } System.out.println(e) System.out.println System.out System System.out e {
            String numString = reader.readLine();
            String[] dataString = reader.readLine().split(" ");

            num = Integer.parseInt(numString);

            data = new int[num];
            for (int i = 0; i < num; i++) {
                data[i] = Integer.parseInt(dataString[i]);
            }
        } String numString = reader.readLine(); numString reader.readLine() reader.readLine reader String[] dataString = reader.readLine().split(" "); dataString reader.readLine().split(" ") reader.readLine().split reader.readLine() reader.readLine reader " " num = Integer.parseInt(numString) num Integer.parseInt(numString) Integer.parseInt Integer numString data = new int[num] data new int[num] num for (int i = 0; i < num; i++) {
                data[i] = Integer.parseInt(dataString[i]);
            } int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
                data[i] = Integer.parseInt(dataString[i]);
            } {
                data[i] = Integer.parseInt(dataString[i]);
            } data[i] = Integer.parseInt(dataString[i]) data[i] data i Integer.parseInt(dataString[i]) Integer.parseInt Integer dataString[i] dataString i static long arrayMin(int[] data) {
        long min = Long.MAX_VALUE;
        for (int i = 0; i < data.length; i++) {
            min = Math.min(min, data[i]);
        }
        return min;
    } arrayMin {
        long min = Long.MAX_VALUE;
        for (int i = 0; i < data.length; i++) {
            min = Math.min(min, data[i]);
        }
        return min;
    } long min = Long.MAX_VALUE; min Long.MAX_VALUE Long Long.MAX_VALUE for (int i = 0; i < data.length; i++) {
            min = Math.min(min, data[i]);
        } int i = 0; int i = 0; i 0 i < data.length i data.length data data.length i++ i++ i {
            min = Math.min(min, data[i]);
        } {
            min = Math.min(min, data[i]);
        } min = Math.min(min, data[i]) min Math.min(min, data[i]) Math.min Math min data[i] data i return min; min int[] data data static long arrayMax(int[] data) {
        long max = Long.MIN_VALUE;
        for (int i = 0; i < data.length; i++) {
            max = Math.max(max, data[i]);
        }
        return max;
    } arrayMax {
        long max = Long.MIN_VALUE;
        for (int i = 0; i < data.length; i++) {
            max = Math.max(max, data[i]);
        }
        return max;
    } long max = Long.MIN_VALUE; max Long.MIN_VALUE Long Long.MIN_VALUE for (int i = 0; i < data.length; i++) {
            max = Math.max(max, data[i]);
        } int i = 0; int i = 0; i 0 i < data.length i data.length data data.length i++ i++ i {
            max = Math.max(max, data[i]);
        } {
            max = Math.max(max, data[i]);
        } max = Math.max(max, data[i]) max Math.max(max, data[i]) Math.max Math max data[i] data i return max; max int[] data data static long arraySum(int[] data) {
        long sum = 0;
        for (int i = 0; i < num; i++) {
            sum += data[i];
        }
        return sum;
    } arraySum {
        long sum = 0;
        for (int i = 0; i < num; i++) {
            sum += data[i];
        }
        return sum;
    } long sum = 0; sum 0 for (int i = 0; i < num; i++) {
            sum += data[i];
        } int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
            sum += data[i];
        } {
            sum += data[i];
        } sum += data[i] sum data[i] data i return sum; sum int[] data data
import java.io.*;

class Main {
    private static int num;
    private static int[] data;

    public static void main(String[] args) {
        dataSet();

        long min = arrayMin(data);
        long max = arrayMax(data);
        long sum = arraySum(data);

        System.out.println(min + " " + max + " " + sum);
    }

    static void dataSet() {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

        try {
            String numString = reader.readLine();
            String[] dataString = reader.readLine().split(" ");

            num = Integer.parseInt(numString);

            data = new int[num];
            for (int i = 0; i < num; i++) {
                data[i] = Integer.parseInt(dataString[i]);
            }
        } catch (NumberFormatException e) {
            System.out.println(e);
        } catch (IOException e) {
            System.out.println(e);
        }
    }

    static long arrayMin(int[] data) {
        long min = Long.MAX_VALUE;
        for (int i = 0; i < data.length; i++) {
            min = Math.min(min, data[i]);
        }
        return min;
    }

    static long arrayMax(int[] data) {
        long max = Long.MIN_VALUE;
        for (int i = 0; i < data.length; i++) {
            max = Math.max(max, data[i]);
        }
        return max;
    }

    static long arraySum(int[] data) {
        long sum = 0;
        for (int i = 0; i < num; i++) {
            sum += data[i];
        }
        return sum;
    }
}