import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner kb=new Scanner(System.in);
		int n=kb.nextInt();
		long a[]=new long[20000];
		long nowMax=0,nowMin=0;
		long sum=0;
		for(int i=0;i<n;i++){
			if(kb.hasNextLong()){
				a[i]=kb.nextLong();
			}else{
				break;
			}

		}
		nowMax=a[0];
		nowMin=a[0];
		for(int i=0;i<n;i++){
			if(nowMax<a[i]){
				nowMax=a[i];
			}if(nowMin>a[i]){
				nowMin=a[i];
			}

			sum+=a[i];
		}

		System.out.printf("%d %d %d\n",nowMin,nowMax,sum);
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner kb=new Scanner(System.in);
		int n=kb.nextInt();
		long a[]=new long[20000];
		long nowMax=0,nowMin=0;
		long sum=0;
		for(int i=0;i<n;i++){
			if(kb.hasNextLong()){
				a[i]=kb.nextLong();
			}else{
				break;
			}

		}
		nowMax=a[0];
		nowMin=a[0];
		for(int i=0;i<n;i++){
			if(nowMax<a[i]){
				nowMax=a[i];
			}if(nowMin>a[i]){
				nowMin=a[i];
			}

			sum+=a[i];
		}

		System.out.printf("%d %d %d\n",nowMin,nowMax,sum);
	}

} Main public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner kb=new Scanner(System.in);
		int n=kb.nextInt();
		long a[]=new long[20000];
		long nowMax=0,nowMin=0;
		long sum=0;
		for(int i=0;i<n;i++){
			if(kb.hasNextLong()){
				a[i]=kb.nextLong();
			}else{
				break;
			}

		}
		nowMax=a[0];
		nowMin=a[0];
		for(int i=0;i<n;i++){
			if(nowMax<a[i]){
				nowMax=a[i];
			}if(nowMin>a[i]){
				nowMin=a[i];
			}

			sum+=a[i];
		}

		System.out.printf("%d %d %d\n",nowMin,nowMax,sum);
	} main {
		// TODO ?????????????????????????????????????????????
		Scanner kb=new Scanner(System.in);
		int n=kb.nextInt();
		long a[]=new long[20000];
		long nowMax=0,nowMin=0;
		long sum=0;
		for(int i=0;i<n;i++){
			if(kb.hasNextLong()){
				a[i]=kb.nextLong();
			}else{
				break;
			}

		}
		nowMax=a[0];
		nowMin=a[0];
		for(int i=0;i<n;i++){
			if(nowMax<a[i]){
				nowMax=a[i];
			}if(nowMin>a[i]){
				nowMin=a[i];
			}

			sum+=a[i];
		}

		System.out.printf("%d %d %d\n",nowMin,nowMax,sum);
	} Scanner kb=new Scanner(System.in); kb new Scanner(System.in) int n=kb.nextInt(); n kb.nextInt() kb.nextInt kb long a[]=new long[20000]; a new long[20000] 20000 long nowMax=0 nowMax 0 nowMin=0; nowMin 0 long sum=0; sum 0 for(int i=0;i<n;i++){
			if(kb.hasNextLong()){
				a[i]=kb.nextLong();
			}else{
				break;
			}

		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			if(kb.hasNextLong()){
				a[i]=kb.nextLong();
			}else{
				break;
			}

		} {
			if(kb.hasNextLong()){
				a[i]=kb.nextLong();
			}else{
				break;
			}

		} if(kb.hasNextLong()){
				a[i]=kb.nextLong();
			}else{
				break;
			} kb.hasNextLong() kb.hasNextLong kb {
				a[i]=kb.nextLong();
			} a[i]=kb.nextLong() a[i] a i kb.nextLong() kb.nextLong kb {
				break;
			} break; nowMax=a[0] nowMax a[0] a 0 nowMin=a[0] nowMin a[0] a 0 for(int i=0;i<n;i++){
			if(nowMax<a[i]){
				nowMax=a[i];
			}if(nowMin>a[i]){
				nowMin=a[i];
			}

			sum+=a[i];
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			if(nowMax<a[i]){
				nowMax=a[i];
			}if(nowMin>a[i]){
				nowMin=a[i];
			}

			sum+=a[i];
		} {
			if(nowMax<a[i]){
				nowMax=a[i];
			}if(nowMin>a[i]){
				nowMin=a[i];
			}

			sum+=a[i];
		} if(nowMax<a[i]){
				nowMax=a[i];
			} nowMax<a[i] nowMax a[i] a i {
				nowMax=a[i];
			} nowMax=a[i] nowMax a[i] a i if(nowMin>a[i]){
				nowMin=a[i];
			} nowMin>a[i] nowMin a[i] a i {
				nowMin=a[i];
			} nowMin=a[i] nowMin a[i] a i sum+=a[i] sum a[i] a i System.out.printf("%d %d %d\n",nowMin,nowMax,sum) System.out.printf System.out System System.out "%d %d %d\n" nowMin nowMax sum String[] args args public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner kb=new Scanner(System.in);
		int n=kb.nextInt();
		long a[]=new long[20000];
		long nowMax=0,nowMin=0;
		long sum=0;
		for(int i=0;i<n;i++){
			if(kb.hasNextLong()){
				a[i]=kb.nextLong();
			}else{
				break;
			}

		}
		nowMax=a[0];
		nowMin=a[0];
		for(int i=0;i<n;i++){
			if(nowMax<a[i]){
				nowMax=a[i];
			}if(nowMin>a[i]){
				nowMin=a[i];
			}

			sum+=a[i];
		}

		System.out.printf("%d %d %d\n",nowMin,nowMax,sum);
	}

} public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner kb=new Scanner(System.in);
		int n=kb.nextInt();
		long a[]=new long[20000];
		long nowMax=0,nowMin=0;
		long sum=0;
		for(int i=0;i<n;i++){
			if(kb.hasNextLong()){
				a[i]=kb.nextLong();
			}else{
				break;
			}

		}
		nowMax=a[0];
		nowMin=a[0];
		for(int i=0;i<n;i++){
			if(nowMax<a[i]){
				nowMax=a[i];
			}if(nowMin>a[i]){
				nowMin=a[i];
			}

			sum+=a[i];
		}

		System.out.printf("%d %d %d\n",nowMin,nowMax,sum);
	}

} Main
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner kb=new Scanner(System.in);
		int n=kb.nextInt();
		long a[]=new long[20000];
		long nowMax=0,nowMin=0;
		long sum=0;
		for(int i=0;i<n;i++){
			if(kb.hasNextLong()){
				a[i]=kb.nextLong();
			}else{
				break;
			}

		}
		nowMax=a[0];
		nowMin=a[0];
		for(int i=0;i<n;i++){
			if(nowMax<a[i]){
				nowMax=a[i];
			}if(nowMin>a[i]){
				nowMin=a[i];
			}

			sum+=a[i];
		}

		System.out.printf("%d %d %d\n",nowMin,nowMax,sum);
	}

}