import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(),max=-1000001,min=1000001,non;long sum=0;
		for (int a=1;a<=n;a++){
			non=sc.nextInt();
		if (non>=max){max=non;}
		if(non<=min){min=non;}
		sum +=non;
		}
		System.out.println(min+" "+max+" "+sum);
	}
} 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(),max=-1000001,min=1000001,non;long sum=0;
		for (int a=1;a<=n;a++){
			non=sc.nextInt();
		if (non>=max){max=non;}
		if(non<=min){min=non;}
		sum +=non;
		}
		System.out.println(min+" "+max+" "+sum);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(),max=-1000001,min=1000001,non;long sum=0;
		for (int a=1;a<=n;a++){
			non=sc.nextInt();
		if (non>=max){max=non;}
		if(non<=min){min=non;}
		sum +=non;
		}
		System.out.println(min+" "+max+" "+sum);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(),max=-1000001,min=1000001,non;long sum=0;
		for (int a=1;a<=n;a++){
			non=sc.nextInt();
		if (non>=max){max=non;}
		if(non<=min){min=non;}
		sum +=non;
		}
		System.out.println(min+" "+max+" "+sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt() n sc.nextInt() sc.nextInt sc max=-1000001 max -1000001 1000001 min=1000001 min 1000001 non; non long sum=0; sum 0 for (int a=1;a<=n;a++){
			non=sc.nextInt();
		if (non>=max){max=non;}
		if(non<=min){min=non;}
		sum +=non;
		} int a=1; int a=1; a 1 a<=n a n a++ a++ a {
			non=sc.nextInt();
		if (non>=max){max=non;}
		if(non<=min){min=non;}
		sum +=non;
		} {
			non=sc.nextInt();
		if (non>=max){max=non;}
		if(non<=min){min=non;}
		sum +=non;
		} non=sc.nextInt() non sc.nextInt() sc.nextInt sc if (non>=max){max=non;} non>=max non max {max=non;} max=non max non if(non<=min){min=non;} non<=min non min {min=non;} min=non min non sum +=non sum non System.out.println(min+" "+max+" "+sum) System.out.println System.out System System.out min+" "+max+" "+sum " " max min+" "+max+" "+sum 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(),max=-1000001,min=1000001,non;long sum=0;
		for (int a=1;a<=n;a++){
			non=sc.nextInt();
		if (non>=max){max=non;}
		if(non<=min){min=non;}
		sum +=non;
		}
		System.out.println(min+" "+max+" "+sum);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(),max=-1000001,min=1000001,non;long sum=0;
		for (int a=1;a<=n;a++){
			non=sc.nextInt();
		if (non>=max){max=non;}
		if(non<=min){min=non;}
		sum +=non;
		}
		System.out.println(min+" "+max+" "+sum);
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(),max=-1000001,min=1000001,non;long sum=0;
		for (int a=1;a<=n;a++){
			non=sc.nextInt();
		if (non>=max){max=non;}
		if(non<=min){min=non;}
		sum +=non;
		}
		System.out.println(min+" "+max+" "+sum);
	}
}