import java.io.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

class Main {
    public static void main(String[] args) throws IOException {
       Scanner in = new Scanner(System.in);
       int n = in.nextInt();

       long sum_ = 0, max_ = -10000000, min_ = 10000000;
       for(int i=0;i<n;i++) {
	       int d = in.nextInt();
	       sum_ += d;
	       min_ = Math.min(min_, d);
	       max_ = Math.max(max_, d);
       }
       if(n == 0) System.out.println("0 0 0\n");
       else System.out.printf("%d %d %d\n", min_, max_, sum_);
    }
} import java.io.*; io.* java import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) throws IOException {
       Scanner in = new Scanner(System.in);
       int n = in.nextInt();

       long sum_ = 0, max_ = -10000000, min_ = 10000000;
       for(int i=0;i<n;i++) {
	       int d = in.nextInt();
	       sum_ += d;
	       min_ = Math.min(min_, d);
	       max_ = Math.max(max_, d);
       }
       if(n == 0) System.out.println("0 0 0\n");
       else System.out.printf("%d %d %d\n", min_, max_, sum_);
    }
} Main public static void main(String[] args) throws IOException {
       Scanner in = new Scanner(System.in);
       int n = in.nextInt();

       long sum_ = 0, max_ = -10000000, min_ = 10000000;
       for(int i=0;i<n;i++) {
	       int d = in.nextInt();
	       sum_ += d;
	       min_ = Math.min(min_, d);
	       max_ = Math.max(max_, d);
       }
       if(n == 0) System.out.println("0 0 0\n");
       else System.out.printf("%d %d %d\n", min_, max_, sum_);
    } main {
       Scanner in = new Scanner(System.in);
       int n = in.nextInt();

       long sum_ = 0, max_ = -10000000, min_ = 10000000;
       for(int i=0;i<n;i++) {
	       int d = in.nextInt();
	       sum_ += d;
	       min_ = Math.min(min_, d);
	       max_ = Math.max(max_, d);
       }
       if(n == 0) System.out.println("0 0 0\n");
       else System.out.printf("%d %d %d\n", min_, max_, sum_);
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int n = in.nextInt(); n in.nextInt() in.nextInt in long sum_ = 0 sum_ 0 max_ = -10000000 max_ -10000000 10000000 min_ = 10000000; min_ 10000000 for(int i=0;i<n;i++) {
	       int d = in.nextInt();
	       sum_ += d;
	       min_ = Math.min(min_, d);
	       max_ = Math.max(max_, d);
       } int i=0; int i=0; i 0 i<n i n i++ i++ i {
	       int d = in.nextInt();
	       sum_ += d;
	       min_ = Math.min(min_, d);
	       max_ = Math.max(max_, d);
       } {
	       int d = in.nextInt();
	       sum_ += d;
	       min_ = Math.min(min_, d);
	       max_ = Math.max(max_, d);
       } int d = in.nextInt(); d in.nextInt() in.nextInt in sum_ += d sum_ d min_ = Math.min(min_, d) min_ Math.min(min_, d) Math.min Math min_ d max_ = Math.max(max_, d) max_ Math.max(max_, d) Math.max Math max_ d if(n == 0) System.out.println("0 0 0\n");
       else System.out.printf("%d %d %d\n", min_, max_, sum_); n == 0 n 0 System.out.println("0 0 0\n") System.out.println System.out System System.out "0 0 0\n" System.out.printf("%d %d %d\n", min_, max_, sum_) System.out.printf System.out System System.out "%d %d %d\n" min_ max_ sum_ String[] args args
import java.io.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

class Main {
    public static void main(String[] args) throws IOException {
       Scanner in = new Scanner(System.in);
       int n = in.nextInt();

       long sum_ = 0, max_ = -10000000, min_ = 10000000;
       for(int i=0;i<n;i++) {
	       int d = in.nextInt();
	       sum_ += d;
	       min_ = Math.min(min_, d);
	       max_ = Math.max(max_, d);
       }
       if(n == 0) System.out.println("0 0 0\n");
       else System.out.printf("%d %d %d\n", min_, max_, sum_);
    }
}