import java.util.*;
public class Main {
	public static void main(String[] args) throws Exception{
		Scanner sc = new Scanner(System.in);
		long n=0;
		String s = sc.nextLine();
		s = sc.nextLine();
		String[] st = s.split(" ");
		long[] a = new long[st.length];
		for(int i=0;i<a.length;i++){
			a[i] = Long.parseLong(st[i]);
		}
		Arrays.sort(a);
		for(long i:a){
			n+=i;
		}
		System.out.println(a[0]+" "+a[a.length-1]+" "+n);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) throws Exception{
		Scanner sc = new Scanner(System.in);
		long n=0;
		String s = sc.nextLine();
		s = sc.nextLine();
		String[] st = s.split(" ");
		long[] a = new long[st.length];
		for(int i=0;i<a.length;i++){
			a[i] = Long.parseLong(st[i]);
		}
		Arrays.sort(a);
		for(long i:a){
			n+=i;
		}
		System.out.println(a[0]+" "+a[a.length-1]+" "+n);
	}
} Main public static void main(String[] args) throws Exception{
		Scanner sc = new Scanner(System.in);
		long n=0;
		String s = sc.nextLine();
		s = sc.nextLine();
		String[] st = s.split(" ");
		long[] a = new long[st.length];
		for(int i=0;i<a.length;i++){
			a[i] = Long.parseLong(st[i]);
		}
		Arrays.sort(a);
		for(long i:a){
			n+=i;
		}
		System.out.println(a[0]+" "+a[a.length-1]+" "+n);
	} main {
		Scanner sc = new Scanner(System.in);
		long n=0;
		String s = sc.nextLine();
		s = sc.nextLine();
		String[] st = s.split(" ");
		long[] a = new long[st.length];
		for(int i=0;i<a.length;i++){
			a[i] = Long.parseLong(st[i]);
		}
		Arrays.sort(a);
		for(long i:a){
			n+=i;
		}
		System.out.println(a[0]+" "+a[a.length-1]+" "+n);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n=0; n 0 String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc s = sc.nextLine() s sc.nextLine() sc.nextLine sc String[] st = s.split(" "); st s.split(" ") s.split s " " long[] a = new long[st.length]; a new long[st.length] st.length st st.length for(int i=0;i<a.length;i++){
			a[i] = Long.parseLong(st[i]);
		} int i=0; int i=0; i 0 i<a.length i a.length a a.length i++ i++ i {
			a[i] = Long.parseLong(st[i]);
		} {
			a[i] = Long.parseLong(st[i]);
		} a[i] = Long.parseLong(st[i]) a[i] a i Long.parseLong(st[i]) Long.parseLong Long st[i] st i Arrays.sort(a) Arrays.sort Arrays a for(long i:a){
			n+=i;
		} long i a {
			n+=i;
		} {
			n+=i;
		} n+=i n i System.out.println(a[0]+" "+a[a.length-1]+" "+n) System.out.println System.out System System.out a[0]+" "+a[a.length-1]+" "+n " " a[a.length-1] a[0]+" "+a[a.length-1]+" "+n a[0] a 0 " " a[a.length-1] a a.length-1 a.length a a.length 1 " " n String[] args args public class Main {
	public static void main(String[] args) throws Exception{
		Scanner sc = new Scanner(System.in);
		long n=0;
		String s = sc.nextLine();
		s = sc.nextLine();
		String[] st = s.split(" ");
		long[] a = new long[st.length];
		for(int i=0;i<a.length;i++){
			a[i] = Long.parseLong(st[i]);
		}
		Arrays.sort(a);
		for(long i:a){
			n+=i;
		}
		System.out.println(a[0]+" "+a[a.length-1]+" "+n);
	}
} public class Main {
	public static void main(String[] args) throws Exception{
		Scanner sc = new Scanner(System.in);
		long n=0;
		String s = sc.nextLine();
		s = sc.nextLine();
		String[] st = s.split(" ");
		long[] a = new long[st.length];
		for(int i=0;i<a.length;i++){
			a[i] = Long.parseLong(st[i]);
		}
		Arrays.sort(a);
		for(long i:a){
			n+=i;
		}
		System.out.println(a[0]+" "+a[a.length-1]+" "+n);
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args) throws Exception{
		Scanner sc = new Scanner(System.in);
		long n=0;
		String s = sc.nextLine();
		s = sc.nextLine();
		String[] st = s.split(" ");
		long[] a = new long[st.length];
		for(int i=0;i<a.length;i++){
			a[i] = Long.parseLong(st[i]);
		}
		Arrays.sort(a);
		for(long i:a){
			n+=i;
		}
		System.out.println(a[0]+" "+a[a.length-1]+" "+n);
	}
}