import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int M=-1000000,m=1000000;
		long S = 0;

		for(int i = 1;i <= n;i++){
			int x = sc.nextInt();
			M = Math.max(M, x);
			m = Math.min(m, x);
			S = S+x;
		}
		System.out.println(m+" "+M+" "+S);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int M=-1000000,m=1000000;
		long S = 0;

		for(int i = 1;i <= n;i++){
			int x = sc.nextInt();
			M = Math.max(M, x);
			m = Math.min(m, x);
			S = S+x;
		}
		System.out.println(m+" "+M+" "+S);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int M=-1000000,m=1000000;
		long S = 0;

		for(int i = 1;i <= n;i++){
			int x = sc.nextInt();
			M = Math.max(M, x);
			m = Math.min(m, x);
			S = S+x;
		}
		System.out.println(m+" "+M+" "+S);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int M=-1000000,m=1000000;
		long S = 0;

		for(int i = 1;i <= n;i++){
			int x = sc.nextInt();
			M = Math.max(M, x);
			m = Math.min(m, x);
			S = S+x;
		}
		System.out.println(m+" "+M+" "+S);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int M=-1000000 M -1000000 1000000 m=1000000; m 1000000 long S = 0; S 0 for(int i = 1;i <= n;i++){
			int x = sc.nextInt();
			M = Math.max(M, x);
			m = Math.min(m, x);
			S = S+x;
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			int x = sc.nextInt();
			M = Math.max(M, x);
			m = Math.min(m, x);
			S = S+x;
		} {
			int x = sc.nextInt();
			M = Math.max(M, x);
			m = Math.min(m, x);
			S = S+x;
		} int x = sc.nextInt(); x sc.nextInt() sc.nextInt sc M = Math.max(M, x) M Math.max(M, x) Math.max Math M x m = Math.min(m, x) m Math.min(m, x) Math.min Math m x S = S+x S S+x S x System.out.println(m+" "+M+" "+S) System.out.println System.out System System.out m+" "+M+" "+S " " M m+" "+M+" "+S m " " M " " S String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int M=-1000000,m=1000000;
		long S = 0;

		for(int i = 1;i <= n;i++){
			int x = sc.nextInt();
			M = Math.max(M, x);
			m = Math.min(m, x);
			S = S+x;
		}
		System.out.println(m+" "+M+" "+S);
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int M=-1000000,m=1000000;
		long S = 0;

		for(int i = 1;i <= n;i++){
			int x = sc.nextInt();
			M = Math.max(M, x);
			m = Math.min(m, x);
			S = S+x;
		}
		System.out.println(m+" "+M+" "+S);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int M=-1000000,m=1000000;
		long S = 0;

		for(int i = 1;i <= n;i++){
			int x = sc.nextInt();
			M = Math.max(M, x);
			m = Math.min(m, x);
			S = S+x;
		}
		System.out.println(m+" "+M+" "+S);
	}
}