import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a = sc.nextInt();
		int s = a; //????°????
		int b = a; //?????§???
		long num = a; //????¨????
		for (int i=1; i<n; i++) {
			a = sc.nextInt();
			num += a;
			if(s>a){
				s = a;
			}else if(b<a){
				b = a;
			}
		}
		System.out.println(s + " " + b + " " + num);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a = sc.nextInt();
		int s = a; //????°????
		int b = a; //?????§???
		long num = a; //????¨????
		for (int i=1; i<n; i++) {
			a = sc.nextInt();
			num += a;
			if(s>a){
				s = a;
			}else if(b<a){
				b = a;
			}
		}
		System.out.println(s + " " + b + " " + num);
	}
} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a = sc.nextInt();
		int s = a; //????°????
		int b = a; //?????§???
		long num = a; //????¨????
		for (int i=1; i<n; i++) {
			a = sc.nextInt();
			num += a;
			if(s>a){
				s = a;
			}else if(b<a){
				b = a;
			}
		}
		System.out.println(s + " " + b + " " + num);
	} main {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a = sc.nextInt();
		int s = a; //????°????
		int b = a; //?????§???
		long num = a; //????¨????
		for (int i=1; i<n; i++) {
			a = sc.nextInt();
			num += a;
			if(s>a){
				s = a;
			}else if(b<a){
				b = a;
			}
		}
		System.out.println(s + " " + b + " " + num);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int s = a; s a int b = a; b a long num = a; num a for (int i=1; i<n; i++) {
			a = sc.nextInt();
			num += a;
			if(s>a){
				s = a;
			}else if(b<a){
				b = a;
			}
		} int i=1; int i=1; i 1 i<n i n i++ i++ i {
			a = sc.nextInt();
			num += a;
			if(s>a){
				s = a;
			}else if(b<a){
				b = a;
			}
		} {
			a = sc.nextInt();
			num += a;
			if(s>a){
				s = a;
			}else if(b<a){
				b = a;
			}
		} a = sc.nextInt() a sc.nextInt() sc.nextInt sc num += a num a if(s>a){
				s = a;
			}else if(b<a){
				b = a;
			} s>a s a {
				s = a;
			} s = a s a if(b<a){
				b = a;
			} b<a b a {
				b = a;
			} b = a b a System.out.println(s + " " + b + " " + num) System.out.println System.out System System.out s + " " + b + " " + num " " b s + " " + b + " " + num s " " b " " num String[] args args public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a = sc.nextInt();
		int s = a; //????°????
		int b = a; //?????§???
		long num = a; //????¨????
		for (int i=1; i<n; i++) {
			a = sc.nextInt();
			num += a;
			if(s>a){
				s = a;
			}else if(b<a){
				b = a;
			}
		}
		System.out.println(s + " " + b + " " + num);
	}
} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a = sc.nextInt();
		int s = a; //????°????
		int b = a; //?????§???
		long num = a; //????¨????
		for (int i=1; i<n; i++) {
			a = sc.nextInt();
			num += a;
			if(s>a){
				s = a;
			}else if(b<a){
				b = a;
			}
		}
		System.out.println(s + " " + b + " " + num);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a = sc.nextInt();
		int s = a; //????°????
		int b = a; //?????§???
		long num = a; //????¨????
		for (int i=1; i<n; i++) {
			a = sc.nextInt();
			num += a;
			if(s>a){
				s = a;
			}else if(b<a){
				b = a;
			}
		}
		System.out.println(s + " " + b + " " + num);
	}
}