import java.util.*;

class Main{
	int n;
	int[] ai;
	Scanner scan = new Scanner(System.in);
	public Main(){
		n=scan.nextInt();
		ai=new int[n];
		for(int i=0; i<n; i++){
			ai[i]=scan.nextInt();
		}
		int min=1000000;
		for(int i=0; i<n; i++){
			if(min>ai[i])min=ai[i];
		}
		int max=-1000000;
		for(int j=0; j<n; j++){
			if(max<ai[j])max=ai[j];
		}
		long sum=0;
		for(int k=0; k<n; k++){
			sum=sum+ai[k];
		}
		System.out.println(min+" "+max+" "+sum);
	}
	public static void main(String[]args){
		new Main();
	}
} import java.util.*; util.* java class Main{
	int n;
	int[] ai;
	Scanner scan = new Scanner(System.in);
	public Main(){
		n=scan.nextInt();
		ai=new int[n];
		for(int i=0; i<n; i++){
			ai[i]=scan.nextInt();
		}
		int min=1000000;
		for(int i=0; i<n; i++){
			if(min>ai[i])min=ai[i];
		}
		int max=-1000000;
		for(int j=0; j<n; j++){
			if(max<ai[j])max=ai[j];
		}
		long sum=0;
		for(int k=0; k<n; k++){
			sum=sum+ai[k];
		}
		System.out.println(min+" "+max+" "+sum);
	}
	public static void main(String[]args){
		new Main();
	}
} Main int n; n int[] ai; ai Scanner scan = new Scanner(System.in); scan new Scanner(System.in) public Main(){
		n=scan.nextInt();
		ai=new int[n];
		for(int i=0; i<n; i++){
			ai[i]=scan.nextInt();
		}
		int min=1000000;
		for(int i=0; i<n; i++){
			if(min>ai[i])min=ai[i];
		}
		int max=-1000000;
		for(int j=0; j<n; j++){
			if(max<ai[j])max=ai[j];
		}
		long sum=0;
		for(int k=0; k<n; k++){
			sum=sum+ai[k];
		}
		System.out.println(min+" "+max+" "+sum);
	} Main {
		n=scan.nextInt();
		ai=new int[n];
		for(int i=0; i<n; i++){
			ai[i]=scan.nextInt();
		}
		int min=1000000;
		for(int i=0; i<n; i++){
			if(min>ai[i])min=ai[i];
		}
		int max=-1000000;
		for(int j=0; j<n; j++){
			if(max<ai[j])max=ai[j];
		}
		long sum=0;
		for(int k=0; k<n; k++){
			sum=sum+ai[k];
		}
		System.out.println(min+" "+max+" "+sum);
	} n=scan.nextInt() n scan.nextInt() scan.nextInt scan ai=new int[n] ai new int[n] n for(int i=0; i<n; i++){
			ai[i]=scan.nextInt();
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			ai[i]=scan.nextInt();
		} {
			ai[i]=scan.nextInt();
		} ai[i]=scan.nextInt() ai[i] ai i scan.nextInt() scan.nextInt scan int min=1000000; min 1000000 for(int i=0; i<n; i++){
			if(min>ai[i])min=ai[i];
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			if(min>ai[i])min=ai[i];
		} {
			if(min>ai[i])min=ai[i];
		} if(min>ai[i])min=ai[i]; min>ai[i] min ai[i] ai i min=ai[i] min ai[i] ai i int max=-1000000; max -1000000 1000000 for(int j=0; j<n; j++){
			if(max<ai[j])max=ai[j];
		} int j=0; int j=0; j 0 j<n j n j++ j++ j {
			if(max<ai[j])max=ai[j];
		} {
			if(max<ai[j])max=ai[j];
		} if(max<ai[j])max=ai[j]; max<ai[j] max ai[j] ai j max=ai[j] max ai[j] ai j long sum=0; sum 0 for(int k=0; k<n; k++){
			sum=sum+ai[k];
		} int k=0; int k=0; k 0 k<n k n k++ k++ k {
			sum=sum+ai[k];
		} {
			sum=sum+ai[k];
		} sum=sum+ai[k] sum sum+ai[k] sum ai[k] ai k System.out.println(min+" "+max+" "+sum) System.out.println System.out System System.out min+" "+max+" "+sum " " max min+" "+max+" "+sum min " " max " " sum public static void main(String[]args){
		new Main();
	} main {
		new Main();
	} new Main() String[]args args
import java.util.*;

class Main{
	int n;
	int[] ai;
	Scanner scan = new Scanner(System.in);
	public Main(){
		n=scan.nextInt();
		ai=new int[n];
		for(int i=0; i<n; i++){
			ai[i]=scan.nextInt();
		}
		int min=1000000;
		for(int i=0; i<n; i++){
			if(min>ai[i])min=ai[i];
		}
		int max=-1000000;
		for(int j=0; j<n; j++){
			if(max<ai[j])max=ai[j];
		}
		long sum=0;
		for(int k=0; k<n; k++){
			sum=sum+ai[k];
		}
		System.out.println(min+" "+max+" "+sum);
	}
	public static void main(String[]args){
		new Main();
	}
}