import java.util.Scanner;

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

public class Main {
	public static void main(String[] args){
		Scanner std = new Scanner(System.in);
		int n = Integer.parseInt(std.next());
		int max = -1000001;
		int min = 1000001;
		long sum = 0;
		for(int i=1; i<=n; i++ ){
			int nxt = Integer.parseInt(std.next());
			if (max<nxt) max = nxt;
			if (nxt<min) min = nxt;
			sum += nxt;
		}
		System.out.println(min+" "+max+" "+sum);
	}
}