import java.util.Scanner;

class Main{
	public static void main(String args[]){
		Scanner scan=new Scanner(System.in);
		String nn=scan.nextLine();
		int n=Integer.parseInt(nn);
		String val=scan.nextLine();
		String [] numnum=val.split(" ",0);
		int [] num=new int [n];
		for(int i=0;i<n;i++){
			num[i]=Integer.parseInt(numnum[i]);
		}
		int max=-10000000;
		int min=10000000;
		long count=0;
		for(int i=0;i<n;i++){
			if(num[i]>max){
				max=num[i];
			}
			if(num[i]<min){
				min=num[i];
			}
			count+=num[i];
		}
		System.out.println(min+" "+max+" "+count);
	}
}
	 import java.util.Scanner; Scanner java.util class Main{
	public static void main(String args[]){
		Scanner scan=new Scanner(System.in);
		String nn=scan.nextLine();
		int n=Integer.parseInt(nn);
		String val=scan.nextLine();
		String [] numnum=val.split(" ",0);
		int [] num=new int [n];
		for(int i=0;i<n;i++){
			num[i]=Integer.parseInt(numnum[i]);
		}
		int max=-10000000;
		int min=10000000;
		long count=0;
		for(int i=0;i<n;i++){
			if(num[i]>max){
				max=num[i];
			}
			if(num[i]<min){
				min=num[i];
			}
			count+=num[i];
		}
		System.out.println(min+" "+max+" "+count);
	}
} Main public static void main(String args[]){
		Scanner scan=new Scanner(System.in);
		String nn=scan.nextLine();
		int n=Integer.parseInt(nn);
		String val=scan.nextLine();
		String [] numnum=val.split(" ",0);
		int [] num=new int [n];
		for(int i=0;i<n;i++){
			num[i]=Integer.parseInt(numnum[i]);
		}
		int max=-10000000;
		int min=10000000;
		long count=0;
		for(int i=0;i<n;i++){
			if(num[i]>max){
				max=num[i];
			}
			if(num[i]<min){
				min=num[i];
			}
			count+=num[i];
		}
		System.out.println(min+" "+max+" "+count);
	} main {
		Scanner scan=new Scanner(System.in);
		String nn=scan.nextLine();
		int n=Integer.parseInt(nn);
		String val=scan.nextLine();
		String [] numnum=val.split(" ",0);
		int [] num=new int [n];
		for(int i=0;i<n;i++){
			num[i]=Integer.parseInt(numnum[i]);
		}
		int max=-10000000;
		int min=10000000;
		long count=0;
		for(int i=0;i<n;i++){
			if(num[i]>max){
				max=num[i];
			}
			if(num[i]<min){
				min=num[i];
			}
			count+=num[i];
		}
		System.out.println(min+" "+max+" "+count);
	} Scanner scan=new Scanner(System.in); scan new Scanner(System.in) String nn=scan.nextLine(); nn scan.nextLine() scan.nextLine scan int n=Integer.parseInt(nn); n Integer.parseInt(nn) Integer.parseInt Integer nn String val=scan.nextLine(); val scan.nextLine() scan.nextLine scan String [] numnum=val.split(" ",0); numnum val.split(" ",0) val.split val " " 0 int [] num=new int [n]; num new int [n] n for(int i=0;i<n;i++){
			num[i]=Integer.parseInt(numnum[i]);
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			num[i]=Integer.parseInt(numnum[i]);
		} {
			num[i]=Integer.parseInt(numnum[i]);
		} num[i]=Integer.parseInt(numnum[i]) num[i] num i Integer.parseInt(numnum[i]) Integer.parseInt Integer numnum[i] numnum i int max=-10000000; max -10000000 10000000 int min=10000000; min 10000000 long count=0; count 0 for(int i=0;i<n;i++){
			if(num[i]>max){
				max=num[i];
			}
			if(num[i]<min){
				min=num[i];
			}
			count+=num[i];
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			if(num[i]>max){
				max=num[i];
			}
			if(num[i]<min){
				min=num[i];
			}
			count+=num[i];
		} {
			if(num[i]>max){
				max=num[i];
			}
			if(num[i]<min){
				min=num[i];
			}
			count+=num[i];
		} if(num[i]>max){
				max=num[i];
			} num[i]>max num[i] num i max {
				max=num[i];
			} max=num[i] max num[i] num i if(num[i]<min){
				min=num[i];
			} num[i]<min num[i] num i min {
				min=num[i];
			} min=num[i] min num[i] num i count+=num[i] count num[i] num i System.out.println(min+" "+max+" "+count) System.out.println System.out System System.out min+" "+max+" "+count " " max min+" "+max+" "+count min " " max " " count String args[] args
import java.util.Scanner;

class Main{
	public static void main(String args[]){
		Scanner scan=new Scanner(System.in);
		String nn=scan.nextLine();
		int n=Integer.parseInt(nn);
		String val=scan.nextLine();
		String [] numnum=val.split(" ",0);
		int [] num=new int [n];
		for(int i=0;i<n;i++){
			num[i]=Integer.parseInt(numnum[i]);
		}
		int max=-10000000;
		int min=10000000;
		long count=0;
		for(int i=0;i<n;i++){
			if(num[i]>max){
				max=num[i];
			}
			if(num[i]<min){
				min=num[i];
			}
			count+=num[i];
		}
		System.out.println(min+" "+max+" "+count);
	}
}
	