import java.util.*;

public class Main {
    public static  void main(String  args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        int max = x;
        int min = x;
        long sum = x;
        for (int i = 1; i < n; i++) {
        	x = sc.nextInt();
        	if (max < x) max = x;
        	if (min > x) min = x;
        	sum += x;
	
        }
        System.out.printf("%d %d %d\n", min, max, sum);
    }
} import java.util.*; util.* java public class Main {
    public static  void main(String  args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        int max = x;
        int min = x;
        long sum = x;
        for (int i = 1; i < n; i++) {
        	x = sc.nextInt();
        	if (max < x) max = x;
        	if (min > x) min = x;
        	sum += x;
	
        }
        System.out.printf("%d %d %d\n", min, max, sum);
    }
} Main public static  void main(String  args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        int max = x;
        int min = x;
        long sum = x;
        for (int i = 1; i < n; i++) {
        	x = sc.nextInt();
        	if (max < x) max = x;
        	if (min > x) min = x;
        	sum += x;
	
        }
        System.out.printf("%d %d %d\n", min, max, sum);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        int max = x;
        int min = x;
        long sum = x;
        for (int i = 1; i < n; i++) {
        	x = sc.nextInt();
        	if (max < x) max = x;
        	if (min > x) min = x;
        	sum += x;
	
        }
        System.out.printf("%d %d %d\n", min, max, sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int x = sc.nextInt(); x sc.nextInt() sc.nextInt sc int max = x; max x int min = x; min x long sum = x; sum x for (int i = 1; i < n; i++) {
        	x = sc.nextInt();
        	if (max < x) max = x;
        	if (min > x) min = x;
        	sum += x;
	
        } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
        	x = sc.nextInt();
        	if (max < x) max = x;
        	if (min > x) min = x;
        	sum += x;
	
        } {
        	x = sc.nextInt();
        	if (max < x) max = x;
        	if (min > x) min = x;
        	sum += x;
	
        } x = sc.nextInt() x sc.nextInt() sc.nextInt sc if (max < x) max = x; max < x max x max = x max x if (min > x) min = x; min > x min x min = x min x sum += x sum x 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 public class Main {
    public static  void main(String  args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        int max = x;
        int min = x;
        long sum = x;
        for (int i = 1; i < n; i++) {
        	x = sc.nextInt();
        	if (max < x) max = x;
        	if (min > x) min = x;
        	sum += x;
	
        }
        System.out.printf("%d %d %d\n", min, max, sum);
    }
} public class Main {
    public static  void main(String  args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        int max = x;
        int min = x;
        long sum = x;
        for (int i = 1; i < n; i++) {
        	x = sc.nextInt();
        	if (max < x) max = x;
        	if (min > x) min = x;
        	sum += x;
	
        }
        System.out.printf("%d %d %d\n", min, max, sum);
    }
} Main
import java.util.*;

public class Main {
    public static  void main(String  args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        int max = x;
        int min = x;
        long sum = x;
        for (int i = 1; i < n; i++) {
        	x = sc.nextInt();
        	if (max < x) max = x;
        	if (min > x) min = x;
        	sum += x;
	
        }
        System.out.printf("%d %d %d\n", min, max, sum);
    }
}