import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);

        int numOfInput = stdIn.nextInt();
        
        long sum = 0L;
        int max = -1000000;
        int min = 1000000;
        for(int i = 0; i < numOfInput; i++) {
            int n = stdIn.nextInt();
            sum += n;
            if(n > max) {
                max = n;
            }
            if(n < min) {
                min = n;
            }
        }
        System.out.println(min + " " + max + " " + sum);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);

        int numOfInput = stdIn.nextInt();
        
        long sum = 0L;
        int max = -1000000;
        int min = 1000000;
        for(int i = 0; i < numOfInput; i++) {
            int n = stdIn.nextInt();
            sum += n;
            if(n > max) {
                max = n;
            }
            if(n < min) {
                min = n;
            }
        }
        System.out.println(min + " " + max + " " + sum);
    }
} Main public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);

        int numOfInput = stdIn.nextInt();
        
        long sum = 0L;
        int max = -1000000;
        int min = 1000000;
        for(int i = 0; i < numOfInput; i++) {
            int n = stdIn.nextInt();
            sum += n;
            if(n > max) {
                max = n;
            }
            if(n < min) {
                min = n;
            }
        }
        System.out.println(min + " " + max + " " + sum);
    } main {
        Scanner stdIn = new Scanner(System.in);

        int numOfInput = stdIn.nextInt();
        
        long sum = 0L;
        int max = -1000000;
        int min = 1000000;
        for(int i = 0; i < numOfInput; i++) {
            int n = stdIn.nextInt();
            sum += n;
            if(n > max) {
                max = n;
            }
            if(n < min) {
                min = n;
            }
        }
        System.out.println(min + " " + max + " " + sum);
    } Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int numOfInput = stdIn.nextInt(); numOfInput stdIn.nextInt() stdIn.nextInt stdIn long sum = 0L; sum 0L int max = -1000000; max -1000000 1000000 int min = 1000000; min 1000000 for(int i = 0; i < numOfInput; i++) {
            int n = stdIn.nextInt();
            sum += n;
            if(n > max) {
                max = n;
            }
            if(n < min) {
                min = n;
            }
        } int i = 0; int i = 0; i 0 i < numOfInput i numOfInput i++ i++ i {
            int n = stdIn.nextInt();
            sum += n;
            if(n > max) {
                max = n;
            }
            if(n < min) {
                min = n;
            }
        } {
            int n = stdIn.nextInt();
            sum += n;
            if(n > max) {
                max = n;
            }
            if(n < min) {
                min = n;
            }
        } int n = stdIn.nextInt(); n stdIn.nextInt() stdIn.nextInt stdIn sum += n sum n if(n > max) {
                max = n;
            } n > max n max {
                max = n;
            } max = n max n if(n < min) {
                min = n;
            } n < min n min {
                min = n;
            } min = n min n 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) {
        Scanner stdIn = new Scanner(System.in);

        int numOfInput = stdIn.nextInt();
        
        long sum = 0L;
        int max = -1000000;
        int min = 1000000;
        for(int i = 0; i < numOfInput; i++) {
            int n = stdIn.nextInt();
            sum += n;
            if(n > max) {
                max = n;
            }
            if(n < min) {
                min = n;
            }
        }
        System.out.println(min + " " + max + " " + sum);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);

        int numOfInput = stdIn.nextInt();
        
        long sum = 0L;
        int max = -1000000;
        int min = 1000000;
        for(int i = 0; i < numOfInput; i++) {
            int n = stdIn.nextInt();
            sum += n;
            if(n > max) {
                max = n;
            }
            if(n < min) {
                min = n;
            }
        }
        System.out.println(min + " " + max + " " + sum);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);

        int numOfInput = stdIn.nextInt();
        
        long sum = 0L;
        int max = -1000000;
        int min = 1000000;
        for(int i = 0; i < numOfInput; i++) {
            int n = stdIn.nextInt();
            sum += n;
            if(n > max) {
                max = n;
            }
            if(n < min) {
                min = n;
            }
        }
        System.out.println(min + " " + max + " " + sum);
    }
}