import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner i=new Scanner(System.in);
		int n=i.nextInt();
		int[] a=new int[n+1];
		for(int s=0;s<n;s++){
			a[s]=i.nextInt();
		}
		int min=Integer.MAX_VALUE;
		int max=Integer.MIN_VALUE;
		long gt=0;
		for(int s=0;s<n;s++){
			if(min>a[s]){min=a[s];}
			if(max<a[s]){max=a[s];}
			gt+=a[s];
		}
		System.out.println(min+" "+max+" "+gt);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner i=new Scanner(System.in);
		int n=i.nextInt();
		int[] a=new int[n+1];
		for(int s=0;s<n;s++){
			a[s]=i.nextInt();
		}
		int min=Integer.MAX_VALUE;
		int max=Integer.MIN_VALUE;
		long gt=0;
		for(int s=0;s<n;s++){
			if(min>a[s]){min=a[s];}
			if(max<a[s]){max=a[s];}
			gt+=a[s];
		}
		System.out.println(min+" "+max+" "+gt);
	}
} Main public static void main(String[] args) {
		Scanner i=new Scanner(System.in);
		int n=i.nextInt();
		int[] a=new int[n+1];
		for(int s=0;s<n;s++){
			a[s]=i.nextInt();
		}
		int min=Integer.MAX_VALUE;
		int max=Integer.MIN_VALUE;
		long gt=0;
		for(int s=0;s<n;s++){
			if(min>a[s]){min=a[s];}
			if(max<a[s]){max=a[s];}
			gt+=a[s];
		}
		System.out.println(min+" "+max+" "+gt);
	} main {
		Scanner i=new Scanner(System.in);
		int n=i.nextInt();
		int[] a=new int[n+1];
		for(int s=0;s<n;s++){
			a[s]=i.nextInt();
		}
		int min=Integer.MAX_VALUE;
		int max=Integer.MIN_VALUE;
		long gt=0;
		for(int s=0;s<n;s++){
			if(min>a[s]){min=a[s];}
			if(max<a[s]){max=a[s];}
			gt+=a[s];
		}
		System.out.println(min+" "+max+" "+gt);
	} Scanner i=new Scanner(System.in); i new Scanner(System.in) int n=i.nextInt(); n i.nextInt() i.nextInt i int[] a=new int[n+1]; a new int[n+1] n+1 n 1 for(int s=0;s<n;s++){
			a[s]=i.nextInt();
		} int s=0; int s=0; s 0 s<n s n s++ s++ s {
			a[s]=i.nextInt();
		} {
			a[s]=i.nextInt();
		} a[s]=i.nextInt() a[s] a s i.nextInt() i.nextInt i int min=Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE int max=Integer.MIN_VALUE; max Integer.MIN_VALUE Integer Integer.MIN_VALUE long gt=0; gt 0 for(int s=0;s<n;s++){
			if(min>a[s]){min=a[s];}
			if(max<a[s]){max=a[s];}
			gt+=a[s];
		} int s=0; int s=0; s 0 s<n s n s++ s++ s {
			if(min>a[s]){min=a[s];}
			if(max<a[s]){max=a[s];}
			gt+=a[s];
		} {
			if(min>a[s]){min=a[s];}
			if(max<a[s]){max=a[s];}
			gt+=a[s];
		} if(min>a[s]){min=a[s];} min>a[s] min a[s] a s {min=a[s];} min=a[s] min a[s] a s if(max<a[s]){max=a[s];} max<a[s] max a[s] a s {max=a[s];} max=a[s] max a[s] a s gt+=a[s] gt a[s] a s System.out.println(min+" "+max+" "+gt) System.out.println System.out System System.out min+" "+max+" "+gt " " max min+" "+max+" "+gt min " " max " " gt String[] args args public class Main {
	public static void main(String[] args) {
		Scanner i=new Scanner(System.in);
		int n=i.nextInt();
		int[] a=new int[n+1];
		for(int s=0;s<n;s++){
			a[s]=i.nextInt();
		}
		int min=Integer.MAX_VALUE;
		int max=Integer.MIN_VALUE;
		long gt=0;
		for(int s=0;s<n;s++){
			if(min>a[s]){min=a[s];}
			if(max<a[s]){max=a[s];}
			gt+=a[s];
		}
		System.out.println(min+" "+max+" "+gt);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner i=new Scanner(System.in);
		int n=i.nextInt();
		int[] a=new int[n+1];
		for(int s=0;s<n;s++){
			a[s]=i.nextInt();
		}
		int min=Integer.MAX_VALUE;
		int max=Integer.MIN_VALUE;
		long gt=0;
		for(int s=0;s<n;s++){
			if(min>a[s]){min=a[s];}
			if(max<a[s]){max=a[s];}
			gt+=a[s];
		}
		System.out.println(min+" "+max+" "+gt);
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner i=new Scanner(System.in);
		int n=i.nextInt();
		int[] a=new int[n+1];
		for(int s=0;s<n;s++){
			a[s]=i.nextInt();
		}
		int min=Integer.MAX_VALUE;
		int max=Integer.MIN_VALUE;
		long gt=0;
		for(int s=0;s<n;s++){
			if(min>a[s]){min=a[s];}
			if(max<a[s]){max=a[s];}
			gt+=a[s];
		}
		System.out.println(min+" "+max+" "+gt);
	}
}