import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		while(scan.hasNext()){
			int x=scan.nextInt();
			
			ArrayList<Integer> list=new ArrayList<Integer>();
			long sum=0;
			for (int i = 0; i < x; i++) {
				int n=scan.nextInt();
				sum +=n;
				list.add(n);
			}
			
			System.out.println(Collections.min(list)+" "+Collections.max(list)+" "+sum);
		}
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		while(scan.hasNext()){
			int x=scan.nextInt();
			
			ArrayList<Integer> list=new ArrayList<Integer>();
			long sum=0;
			for (int i = 0; i < x; i++) {
				int n=scan.nextInt();
				sum +=n;
				list.add(n);
			}
			
			System.out.println(Collections.min(list)+" "+Collections.max(list)+" "+sum);
		}
	}

} Main public static void main(String[] args) {
		Scanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		while(scan.hasNext()){
			int x=scan.nextInt();
			
			ArrayList<Integer> list=new ArrayList<Integer>();
			long sum=0;
			for (int i = 0; i < x; i++) {
				int n=scan.nextInt();
				sum +=n;
				list.add(n);
			}
			
			System.out.println(Collections.min(list)+" "+Collections.max(list)+" "+sum);
		}
	} main {
		Scanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		while(scan.hasNext()){
			int x=scan.nextInt();
			
			ArrayList<Integer> list=new ArrayList<Integer>();
			long sum=0;
			for (int i = 0; i < x; i++) {
				int n=scan.nextInt();
				sum +=n;
				list.add(n);
			}
			
			System.out.println(Collections.min(list)+" "+Collections.max(list)+" "+sum);
		}
	} Scanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in))); scan new Scanner(new BufferedReader(new InputStreamReader(System.in))) while(scan.hasNext()){
			int x=scan.nextInt();
			
			ArrayList<Integer> list=new ArrayList<Integer>();
			long sum=0;
			for (int i = 0; i < x; i++) {
				int n=scan.nextInt();
				sum +=n;
				list.add(n);
			}
			
			System.out.println(Collections.min(list)+" "+Collections.max(list)+" "+sum);
		} scan.hasNext() scan.hasNext scan {
			int x=scan.nextInt();
			
			ArrayList<Integer> list=new ArrayList<Integer>();
			long sum=0;
			for (int i = 0; i < x; i++) {
				int n=scan.nextInt();
				sum +=n;
				list.add(n);
			}
			
			System.out.println(Collections.min(list)+" "+Collections.max(list)+" "+sum);
		} int x=scan.nextInt(); x scan.nextInt() scan.nextInt scan ArrayList<Integer> list=new ArrayList<Integer>(); list new ArrayList<Integer>() long sum=0; sum 0 for (int i = 0; i < x; i++) {
				int n=scan.nextInt();
				sum +=n;
				list.add(n);
			} int i = 0; int i = 0; i 0 i < x i x i++ i++ i {
				int n=scan.nextInt();
				sum +=n;
				list.add(n);
			} {
				int n=scan.nextInt();
				sum +=n;
				list.add(n);
			} int n=scan.nextInt(); n scan.nextInt() scan.nextInt scan sum +=n sum n list.add(n) list.add list n System.out.println(Collections.min(list)+" "+Collections.max(list)+" "+sum) System.out.println System.out System System.out Collections.min(list)+" "+Collections.max(list)+" "+sum " " Collections.max(list) Collections.min(list)+" "+Collections.max(list)+" "+sum Collections.min(list) Collections.min Collections list " " Collections.max(list) Collections.max Collections list " " sum String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		while(scan.hasNext()){
			int x=scan.nextInt();
			
			ArrayList<Integer> list=new ArrayList<Integer>();
			long sum=0;
			for (int i = 0; i < x; i++) {
				int n=scan.nextInt();
				sum +=n;
				list.add(n);
			}
			
			System.out.println(Collections.min(list)+" "+Collections.max(list)+" "+sum);
		}
	}

} public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		while(scan.hasNext()){
			int x=scan.nextInt();
			
			ArrayList<Integer> list=new ArrayList<Integer>();
			long sum=0;
			for (int i = 0; i < x; i++) {
				int n=scan.nextInt();
				sum +=n;
				list.add(n);
			}
			
			System.out.println(Collections.min(list)+" "+Collections.max(list)+" "+sum);
		}
	}

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		while(scan.hasNext()){
			int x=scan.nextInt();
			
			ArrayList<Integer> list=new ArrayList<Integer>();
			long sum=0;
			for (int i = 0; i < x; i++) {
				int n=scan.nextInt();
				sum +=n;
				list.add(n);
			}
			
			System.out.println(Collections.min(list)+" "+Collections.max(list)+" "+sum);
		}
	}

}