
import java.util.Scanner;

public class Main {

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

        int a = scanner.nextInt();
        int b = scanner.nextInt();
        long goukei = b;
        long saishou = b, saidai = b;

        for (int i = 1; i <= a -1; i++) {
            if (a < 0 && a >= 10000) {
                break;
            }
            b = scanner.nextInt();
            if (-1000000 > b && b >= 1000000) {
                break;
            }
            goukei = b + goukei;
            if (saishou > b) {
                saishou = b;
            }
            if (saidai < b) {
                saidai = b;
            }
        }
        System.out.printf("%d %d %d\n",saishou,saidai,goukei);
    }
} import java.util.Scanner; Scanner java.util public class Main {

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

        int a = scanner.nextInt();
        int b = scanner.nextInt();
        long goukei = b;
        long saishou = b, saidai = b;

        for (int i = 1; i <= a -1; i++) {
            if (a < 0 && a >= 10000) {
                break;
            }
            b = scanner.nextInt();
            if (-1000000 > b && b >= 1000000) {
                break;
            }
            goukei = b + goukei;
            if (saishou > b) {
                saishou = b;
            }
            if (saidai < b) {
                saidai = b;
            }
        }
        System.out.printf("%d %d %d\n",saishou,saidai,goukei);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int a = scanner.nextInt();
        int b = scanner.nextInt();
        long goukei = b;
        long saishou = b, saidai = b;

        for (int i = 1; i <= a -1; i++) {
            if (a < 0 && a >= 10000) {
                break;
            }
            b = scanner.nextInt();
            if (-1000000 > b && b >= 1000000) {
                break;
            }
            goukei = b + goukei;
            if (saishou > b) {
                saishou = b;
            }
            if (saidai < b) {
                saidai = b;
            }
        }
        System.out.printf("%d %d %d\n",saishou,saidai,goukei);
    } main {
        Scanner scanner = new Scanner(System.in);

        int a = scanner.nextInt();
        int b = scanner.nextInt();
        long goukei = b;
        long saishou = b, saidai = b;

        for (int i = 1; i <= a -1; i++) {
            if (a < 0 && a >= 10000) {
                break;
            }
            b = scanner.nextInt();
            if (-1000000 > b && b >= 1000000) {
                break;
            }
            goukei = b + goukei;
            if (saishou > b) {
                saishou = b;
            }
            if (saidai < b) {
                saidai = b;
            }
        }
        System.out.printf("%d %d %d\n",saishou,saidai,goukei);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int a = scanner.nextInt(); a scanner.nextInt() scanner.nextInt scanner int b = scanner.nextInt(); b scanner.nextInt() scanner.nextInt scanner long goukei = b; goukei b long saishou = b saishou b saidai = b; saidai b for (int i = 1; i <= a -1; i++) {
            if (a < 0 && a >= 10000) {
                break;
            }
            b = scanner.nextInt();
            if (-1000000 > b && b >= 1000000) {
                break;
            }
            goukei = b + goukei;
            if (saishou > b) {
                saishou = b;
            }
            if (saidai < b) {
                saidai = b;
            }
        } int i = 1; int i = 1; i 1 i <= a -1 i a -1 a 1 i++ i++ i {
            if (a < 0 && a >= 10000) {
                break;
            }
            b = scanner.nextInt();
            if (-1000000 > b && b >= 1000000) {
                break;
            }
            goukei = b + goukei;
            if (saishou > b) {
                saishou = b;
            }
            if (saidai < b) {
                saidai = b;
            }
        } {
            if (a < 0 && a >= 10000) {
                break;
            }
            b = scanner.nextInt();
            if (-1000000 > b && b >= 1000000) {
                break;
            }
            goukei = b + goukei;
            if (saishou > b) {
                saishou = b;
            }
            if (saidai < b) {
                saidai = b;
            }
        } if (a < 0 && a >= 10000) {
                break;
            } a < 0 && a >= 10000 a < 0 a 0 a >= 10000 a 10000 {
                break;
            } break; b = scanner.nextInt() b scanner.nextInt() scanner.nextInt scanner if (-1000000 > b && b >= 1000000) {
                break;
            } -1000000 > b && b >= 1000000 -1000000 > b -1000000 1000000 b b >= 1000000 b 1000000 {
                break;
            } break; goukei = b + goukei goukei b + goukei b goukei if (saishou > b) {
                saishou = b;
            } saishou > b saishou b {
                saishou = b;
            } saishou = b saishou b if (saidai < b) {
                saidai = b;
            } saidai < b saidai b {
                saidai = b;
            } saidai = b saidai b System.out.printf("%d %d %d\n",saishou,saidai,goukei) System.out.printf System.out System System.out "%d %d %d\n" saishou saidai goukei String[] args args public class Main {

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

        int a = scanner.nextInt();
        int b = scanner.nextInt();
        long goukei = b;
        long saishou = b, saidai = b;

        for (int i = 1; i <= a -1; i++) {
            if (a < 0 && a >= 10000) {
                break;
            }
            b = scanner.nextInt();
            if (-1000000 > b && b >= 1000000) {
                break;
            }
            goukei = b + goukei;
            if (saishou > b) {
                saishou = b;
            }
            if (saidai < b) {
                saidai = b;
            }
        }
        System.out.printf("%d %d %d\n",saishou,saidai,goukei);
    }
} public class Main {

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

        int a = scanner.nextInt();
        int b = scanner.nextInt();
        long goukei = b;
        long saishou = b, saidai = b;

        for (int i = 1; i <= a -1; i++) {
            if (a < 0 && a >= 10000) {
                break;
            }
            b = scanner.nextInt();
            if (-1000000 > b && b >= 1000000) {
                break;
            }
            goukei = b + goukei;
            if (saishou > b) {
                saishou = b;
            }
            if (saidai < b) {
                saidai = b;
            }
        }
        System.out.printf("%d %d %d\n",saishou,saidai,goukei);
    }
} Main

import java.util.Scanner;

public class Main {

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

        int a = scanner.nextInt();
        int b = scanner.nextInt();
        long goukei = b;
        long saishou = b, saidai = b;

        for (int i = 1; i <= a -1; i++) {
            if (a < 0 && a >= 10000) {
                break;
            }
            b = scanner.nextInt();
            if (-1000000 > b && b >= 1000000) {
                break;
            }
            goukei = b + goukei;
            if (saishou > b) {
                saishou = b;
            }
            if (saidai < b) {
                saidai = b;
            }
        }
        System.out.printf("%d %d %d\n",saishou,saidai,goukei);
    }
}