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

public class Main {
    public static void main (String[] args) throws IOException {
        int c;
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder builder = new StringBuilder();        

        String data = reader.readLine();
        c = Integer.parseInt(data);
        int[] array = new int[c];

        data = reader.readLine();
        String[] number = data.split(" ");
        for (int i = 0; i < c ; i++ ) {
            array[i] = Integer.parseInt(number[i]);
        }
        int max = Max(array);
        int min = Min(array);
        long sum = Sum(array);
        builder
           .append(min)
           .append(" ")
           .append(max)
           .append(" ")
           .append(sum);
        System.out.println(builder);
        
    }
    public static int Max (int[] array){
        int i;
        int max = array[0];
        for (i = 0; i < array.length-1 ; i++ ) {
            if ( max < array[i+1])
                max = array[i+1];
        }
        return max;
    }
    public static int Min (int[] array){
        int i;
        int min = array[0];
        for (i = 0; i < array.length-1 ; i++ ) {
            if ( min > array[i+1])
                min = array[i+1];
        }
        return min;
    }
    public static long Sum (int[] array){
        int i;
        long sum = array[0];
        for (i = 0; i < array.length-1 ; i++ ) {
                sum += array[i+1];
        }
        return 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 {
        int c;
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder builder = new StringBuilder();        

        String data = reader.readLine();
        c = Integer.parseInt(data);
        int[] array = new int[c];

        data = reader.readLine();
        String[] number = data.split(" ");
        for (int i = 0; i < c ; i++ ) {
            array[i] = Integer.parseInt(number[i]);
        }
        int max = Max(array);
        int min = Min(array);
        long sum = Sum(array);
        builder
           .append(min)
           .append(" ")
           .append(max)
           .append(" ")
           .append(sum);
        System.out.println(builder);
        
    }
    public static int Max (int[] array){
        int i;
        int max = array[0];
        for (i = 0; i < array.length-1 ; i++ ) {
            if ( max < array[i+1])
                max = array[i+1];
        }
        return max;
    }
    public static int Min (int[] array){
        int i;
        int min = array[0];
        for (i = 0; i < array.length-1 ; i++ ) {
            if ( min > array[i+1])
                min = array[i+1];
        }
        return min;
    }
    public static long Sum (int[] array){
        int i;
        long sum = array[0];
        for (i = 0; i < array.length-1 ; i++ ) {
                sum += array[i+1];
        }
        return sum;
    }
} Main public static void main (String[] args) throws IOException {
        int c;
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder builder = new StringBuilder();        

        String data = reader.readLine();
        c = Integer.parseInt(data);
        int[] array = new int[c];

        data = reader.readLine();
        String[] number = data.split(" ");
        for (int i = 0; i < c ; i++ ) {
            array[i] = Integer.parseInt(number[i]);
        }
        int max = Max(array);
        int min = Min(array);
        long sum = Sum(array);
        builder
           .append(min)
           .append(" ")
           .append(max)
           .append(" ")
           .append(sum);
        System.out.println(builder);
        
    } main {
        int c;
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder builder = new StringBuilder();        

        String data = reader.readLine();
        c = Integer.parseInt(data);
        int[] array = new int[c];

        data = reader.readLine();
        String[] number = data.split(" ");
        for (int i = 0; i < c ; i++ ) {
            array[i] = Integer.parseInt(number[i]);
        }
        int max = Max(array);
        int min = Min(array);
        long sum = Sum(array);
        builder
           .append(min)
           .append(" ")
           .append(max)
           .append(" ")
           .append(sum);
        System.out.println(builder);
        
    } int c; c BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) StringBuilder builder = new StringBuilder(); builder new StringBuilder() String data = reader.readLine(); data reader.readLine() reader.readLine reader c = Integer.parseInt(data) c Integer.parseInt(data) Integer.parseInt Integer data int[] array = new int[c]; array new int[c] c data = reader.readLine() data reader.readLine() reader.readLine reader String[] number = data.split(" "); number data.split(" ") data.split data " " for (int i = 0; i < c ; i++ ) {
            array[i] = Integer.parseInt(number[i]);
        } int i = 0; int i = 0; i 0 i < c i c i++ i++ i {
            array[i] = Integer.parseInt(number[i]);
        } {
            array[i] = Integer.parseInt(number[i]);
        } array[i] = Integer.parseInt(number[i]) array[i] array i Integer.parseInt(number[i]) Integer.parseInt Integer number[i] number i int max = Max(array); max Max(array) Max array int min = Min(array); min Min(array) Min array long sum = Sum(array); sum Sum(array) Sum array builder
           .append(min)
           .append(" ")
           .append(max)
           .append(" ")
           .append(sum) builder
           .append(min)
           .append(" ")
           .append(max)
           .append(" ")
           .append builder
           .append(min)
           .append(" ")
           .append(max)
           .append(" ") builder
           .append(min)
           .append(" ")
           .append(max)
           .append builder
           .append(min)
           .append(" ")
           .append(max) builder
           .append(min)
           .append(" ")
           .append builder
           .append(min)
           .append(" ") builder
           .append(min)
           .append builder
           .append(min) builder
           .append builder min " " max " " sum System.out.println(builder) System.out.println System.out System System.out builder String[] args args public static int Max (int[] array){
        int i;
        int max = array[0];
        for (i = 0; i < array.length-1 ; i++ ) {
            if ( max < array[i+1])
                max = array[i+1];
        }
        return max;
    } Max {
        int i;
        int max = array[0];
        for (i = 0; i < array.length-1 ; i++ ) {
            if ( max < array[i+1])
                max = array[i+1];
        }
        return max;
    } int i; i int max = array[0]; max array[0] array 0 for (i = 0; i < array.length-1 ; i++ ) {
            if ( max < array[i+1])
                max = array[i+1];
        } i = 0; i = 0 i 0 i < array.length-1 i array.length-1 array.length array array.length 1 i++ i++ i {
            if ( max < array[i+1])
                max = array[i+1];
        } {
            if ( max < array[i+1])
                max = array[i+1];
        } if ( max < array[i+1])
                max = array[i+1]; max < array[i+1] max array[i+1] array i+1 i 1 max = array[i+1] max array[i+1] array i+1 i 1 return max; max int[] array array public static int Min (int[] array){
        int i;
        int min = array[0];
        for (i = 0; i < array.length-1 ; i++ ) {
            if ( min > array[i+1])
                min = array[i+1];
        }
        return min;
    } Min {
        int i;
        int min = array[0];
        for (i = 0; i < array.length-1 ; i++ ) {
            if ( min > array[i+1])
                min = array[i+1];
        }
        return min;
    } int i; i int min = array[0]; min array[0] array 0 for (i = 0; i < array.length-1 ; i++ ) {
            if ( min > array[i+1])
                min = array[i+1];
        } i = 0; i = 0 i 0 i < array.length-1 i array.length-1 array.length array array.length 1 i++ i++ i {
            if ( min > array[i+1])
                min = array[i+1];
        } {
            if ( min > array[i+1])
                min = array[i+1];
        } if ( min > array[i+1])
                min = array[i+1]; min > array[i+1] min array[i+1] array i+1 i 1 min = array[i+1] min array[i+1] array i+1 i 1 return min; min int[] array array public static long Sum (int[] array){
        int i;
        long sum = array[0];
        for (i = 0; i < array.length-1 ; i++ ) {
                sum += array[i+1];
        }
        return sum;
    } Sum {
        int i;
        long sum = array[0];
        for (i = 0; i < array.length-1 ; i++ ) {
                sum += array[i+1];
        }
        return sum;
    } int i; i long sum = array[0]; sum array[0] array 0 for (i = 0; i < array.length-1 ; i++ ) {
                sum += array[i+1];
        } i = 0; i = 0 i 0 i < array.length-1 i array.length-1 array.length array array.length 1 i++ i++ i {
                sum += array[i+1];
        } {
                sum += array[i+1];
        } sum += array[i+1] sum array[i+1] array i+1 i 1 return sum; sum int[] array array public class Main {
    public static void main (String[] args) throws IOException {
        int c;
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder builder = new StringBuilder();        

        String data = reader.readLine();
        c = Integer.parseInt(data);
        int[] array = new int[c];

        data = reader.readLine();
        String[] number = data.split(" ");
        for (int i = 0; i < c ; i++ ) {
            array[i] = Integer.parseInt(number[i]);
        }
        int max = Max(array);
        int min = Min(array);
        long sum = Sum(array);
        builder
           .append(min)
           .append(" ")
           .append(max)
           .append(" ")
           .append(sum);
        System.out.println(builder);
        
    }
    public static int Max (int[] array){
        int i;
        int max = array[0];
        for (i = 0; i < array.length-1 ; i++ ) {
            if ( max < array[i+1])
                max = array[i+1];
        }
        return max;
    }
    public static int Min (int[] array){
        int i;
        int min = array[0];
        for (i = 0; i < array.length-1 ; i++ ) {
            if ( min > array[i+1])
                min = array[i+1];
        }
        return min;
    }
    public static long Sum (int[] array){
        int i;
        long sum = array[0];
        for (i = 0; i < array.length-1 ; i++ ) {
                sum += array[i+1];
        }
        return sum;
    }
} public class Main {
    public static void main (String[] args) throws IOException {
        int c;
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder builder = new StringBuilder();        

        String data = reader.readLine();
        c = Integer.parseInt(data);
        int[] array = new int[c];

        data = reader.readLine();
        String[] number = data.split(" ");
        for (int i = 0; i < c ; i++ ) {
            array[i] = Integer.parseInt(number[i]);
        }
        int max = Max(array);
        int min = Min(array);
        long sum = Sum(array);
        builder
           .append(min)
           .append(" ")
           .append(max)
           .append(" ")
           .append(sum);
        System.out.println(builder);
        
    }
    public static int Max (int[] array){
        int i;
        int max = array[0];
        for (i = 0; i < array.length-1 ; i++ ) {
            if ( max < array[i+1])
                max = array[i+1];
        }
        return max;
    }
    public static int Min (int[] array){
        int i;
        int min = array[0];
        for (i = 0; i < array.length-1 ; i++ ) {
            if ( min > array[i+1])
                min = array[i+1];
        }
        return min;
    }
    public static long Sum (int[] array){
        int i;
        long sum = array[0];
        for (i = 0; i < array.length-1 ; i++ ) {
                sum += array[i+1];
        }
        return 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 {
        int c;
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder builder = new StringBuilder();        

        String data = reader.readLine();
        c = Integer.parseInt(data);
        int[] array = new int[c];

        data = reader.readLine();
        String[] number = data.split(" ");
        for (int i = 0; i < c ; i++ ) {
            array[i] = Integer.parseInt(number[i]);
        }
        int max = Max(array);
        int min = Min(array);
        long sum = Sum(array);
        builder
           .append(min)
           .append(" ")
           .append(max)
           .append(" ")
           .append(sum);
        System.out.println(builder);
        
    }
    public static int Max (int[] array){
        int i;
        int max = array[0];
        for (i = 0; i < array.length-1 ; i++ ) {
            if ( max < array[i+1])
                max = array[i+1];
        }
        return max;
    }
    public static int Min (int[] array){
        int i;
        int min = array[0];
        for (i = 0; i < array.length-1 ; i++ ) {
            if ( min > array[i+1])
                min = array[i+1];
        }
        return min;
    }
    public static long Sum (int[] array){
        int i;
        long sum = array[0];
        for (i = 0; i < array.length-1 ; i++ ) {
                sum += array[i+1];
        }
        return sum;
    }
}