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

public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        int num = Integer.valueOf(br.readLine());

        String[] preValues = br.readLine().split(" " , num);
        long[] values = new long[num];

        for(int i = 0; i < num; i++){
            values[i] = Integer.parseInt(preValues[i]);
        }

        System.out.print(getMin(values) + " ");
        System.out.print(getMax(values) + " ");
        System.out.println(sum(values));

    }

    private static long getMin(long[] data){
        long min = data[0];

        for(int i = 1; i < data.length; i++){
            if(min > data[i]) min = data[i];
        }

        return min;
    }

    private static long getMax(long[] data){
        long max = data[0];

        for(int i = 1; i < data.length; i++){
            if(max < data[i]) max = data[i];
        }

        return max;
    }

    private static long sum(long[] data){
        long sum = 0;

        for(int i = 0; i < data.length; i++){
            sum += data[i];
        }

        return sum;
    }

} import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.BufferedReader; BufferedReader java.io public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        int num = Integer.valueOf(br.readLine());

        String[] preValues = br.readLine().split(" " , num);
        long[] values = new long[num];

        for(int i = 0; i < num; i++){
            values[i] = Integer.parseInt(preValues[i]);
        }

        System.out.print(getMin(values) + " ");
        System.out.print(getMax(values) + " ");
        System.out.println(sum(values));

    }

    private static long getMin(long[] data){
        long min = data[0];

        for(int i = 1; i < data.length; i++){
            if(min > data[i]) min = data[i];
        }

        return min;
    }

    private static long getMax(long[] data){
        long max = data[0];

        for(int i = 1; i < data.length; i++){
            if(max < data[i]) max = data[i];
        }

        return max;
    }

    private static long sum(long[] data){
        long sum = 0;

        for(int i = 0; i < data.length; i++){
            sum += data[i];
        }

        return sum;
    }

} Main public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        int num = Integer.valueOf(br.readLine());

        String[] preValues = br.readLine().split(" " , num);
        long[] values = new long[num];

        for(int i = 0; i < num; i++){
            values[i] = Integer.parseInt(preValues[i]);
        }

        System.out.print(getMin(values) + " ");
        System.out.print(getMax(values) + " ");
        System.out.println(sum(values));

    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        int num = Integer.valueOf(br.readLine());

        String[] preValues = br.readLine().split(" " , num);
        long[] values = new long[num];

        for(int i = 0; i < num; i++){
            values[i] = Integer.parseInt(preValues[i]);
        }

        System.out.print(getMin(values) + " ");
        System.out.print(getMax(values) + " ");
        System.out.println(sum(values));

    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int num = Integer.valueOf(br.readLine()); num Integer.valueOf(br.readLine()) Integer.valueOf Integer br.readLine() br.readLine br String[] preValues = br.readLine().split(" " , num); preValues br.readLine().split(" " , num) br.readLine().split br.readLine() br.readLine br " " num long[] values = new long[num]; values new long[num] num for(int i = 0; i < num; i++){
            values[i] = Integer.parseInt(preValues[i]);
        } int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
            values[i] = Integer.parseInt(preValues[i]);
        } {
            values[i] = Integer.parseInt(preValues[i]);
        } values[i] = Integer.parseInt(preValues[i]) values[i] values i Integer.parseInt(preValues[i]) Integer.parseInt Integer preValues[i] preValues i System.out.print(getMin(values) + " ") System.out.print System.out System System.out getMin(values) + " " getMin(values) getMin values " " System.out.print(getMax(values) + " ") System.out.print System.out System System.out getMax(values) + " " getMax(values) getMax values " " System.out.println(sum(values)) System.out.println System.out System System.out sum(values) sum values String[] args args private static long getMin(long[] data){
        long min = data[0];

        for(int i = 1; i < data.length; i++){
            if(min > data[i]) min = data[i];
        }

        return min;
    } getMin {
        long min = data[0];

        for(int i = 1; i < data.length; i++){
            if(min > data[i]) min = data[i];
        }

        return min;
    } long min = data[0]; min data[0] data 0 for(int i = 1; i < data.length; i++){
            if(min > data[i]) min = data[i];
        } int i = 1; int i = 1; i 1 i < data.length i data.length data data.length i++ i++ i {
            if(min > data[i]) min = data[i];
        } {
            if(min > data[i]) min = data[i];
        } if(min > data[i]) min = data[i]; min > data[i] min data[i] data i min = data[i] min data[i] data i return min; min long[] data data private static long getMax(long[] data){
        long max = data[0];

        for(int i = 1; i < data.length; i++){
            if(max < data[i]) max = data[i];
        }

        return max;
    } getMax {
        long max = data[0];

        for(int i = 1; i < data.length; i++){
            if(max < data[i]) max = data[i];
        }

        return max;
    } long max = data[0]; max data[0] data 0 for(int i = 1; i < data.length; i++){
            if(max < data[i]) max = data[i];
        } int i = 1; int i = 1; i 1 i < data.length i data.length data data.length i++ i++ i {
            if(max < data[i]) max = data[i];
        } {
            if(max < data[i]) max = data[i];
        } if(max < data[i]) max = data[i]; max < data[i] max data[i] data i max = data[i] max data[i] data i return max; max long[] data data private static long sum(long[] data){
        long sum = 0;

        for(int i = 0; i < data.length; i++){
            sum += data[i];
        }

        return sum;
    } sum {
        long sum = 0;

        for(int i = 0; i < data.length; i++){
            sum += data[i];
        }

        return sum;
    } long sum = 0; sum 0 for(int i = 0; i < data.length; i++){
            sum += data[i];
        } int i = 0; int i = 0; i 0 i < data.length i data.length data data.length i++ i++ i {
            sum += data[i];
        } {
            sum += data[i];
        } sum += data[i] sum data[i] data i return sum; sum long[] data data public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        int num = Integer.valueOf(br.readLine());

        String[] preValues = br.readLine().split(" " , num);
        long[] values = new long[num];

        for(int i = 0; i < num; i++){
            values[i] = Integer.parseInt(preValues[i]);
        }

        System.out.print(getMin(values) + " ");
        System.out.print(getMax(values) + " ");
        System.out.println(sum(values));

    }

    private static long getMin(long[] data){
        long min = data[0];

        for(int i = 1; i < data.length; i++){
            if(min > data[i]) min = data[i];
        }

        return min;
    }

    private static long getMax(long[] data){
        long max = data[0];

        for(int i = 1; i < data.length; i++){
            if(max < data[i]) max = data[i];
        }

        return max;
    }

    private static long sum(long[] data){
        long sum = 0;

        for(int i = 0; i < data.length; i++){
            sum += data[i];
        }

        return sum;
    }

} public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        int num = Integer.valueOf(br.readLine());

        String[] preValues = br.readLine().split(" " , num);
        long[] values = new long[num];

        for(int i = 0; i < num; i++){
            values[i] = Integer.parseInt(preValues[i]);
        }

        System.out.print(getMin(values) + " ");
        System.out.print(getMax(values) + " ");
        System.out.println(sum(values));

    }

    private static long getMin(long[] data){
        long min = data[0];

        for(int i = 1; i < data.length; i++){
            if(min > data[i]) min = data[i];
        }

        return min;
    }

    private static long getMax(long[] data){
        long max = data[0];

        for(int i = 1; i < data.length; i++){
            if(max < data[i]) max = data[i];
        }

        return max;
    }

    private static long sum(long[] data){
        long sum = 0;

        for(int i = 0; i < data.length; i++){
            sum += data[i];
        }

        return sum;
    }

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

public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        int num = Integer.valueOf(br.readLine());

        String[] preValues = br.readLine().split(" " , num);
        long[] values = new long[num];

        for(int i = 0; i < num; i++){
            values[i] = Integer.parseInt(preValues[i]);
        }

        System.out.print(getMin(values) + " ");
        System.out.print(getMax(values) + " ");
        System.out.println(sum(values));

    }

    private static long getMin(long[] data){
        long min = data[0];

        for(int i = 1; i < data.length; i++){
            if(min > data[i]) min = data[i];
        }

        return min;
    }

    private static long getMax(long[] data){
        long max = data[0];

        for(int i = 1; i < data.length; i++){
            if(max < data[i]) max = data[i];
        }

        return max;
    }

    private static long sum(long[] data){
        long sum = 0;

        for(int i = 0; i < data.length; i++){
            sum += data[i];
        }

        return sum;
    }

}