import java.io.*;
import java.util.Arrays;
class Main{
	public static void main(String[] args) throws IOException {
		int i,m,max,min;
		long sum;
		int[] n = new int[990000];
		String[] str = new String[990000];
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		str = in.readLine().split(" ");
		m = Integer.parseInt(str[0]);
		str = in.readLine().split(" "); 
		sum = max = min = Integer.parseInt(str[0]);
		for(i=1;i<m;i++){
			n[i] = Integer.parseInt(str[i]);
			max = Math.max(max,n[i]);
			min = Math.min(min,n[i]);
			sum += n[i];
		}
		System.out.println(min+" "+max+" "+sum);
	}
} import java.io.*; io.* java import java.util.Arrays; Arrays java.util class Main{
	public static void main(String[] args) throws IOException {
		int i,m,max,min;
		long sum;
		int[] n = new int[990000];
		String[] str = new String[990000];
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		str = in.readLine().split(" ");
		m = Integer.parseInt(str[0]);
		str = in.readLine().split(" "); 
		sum = max = min = Integer.parseInt(str[0]);
		for(i=1;i<m;i++){
			n[i] = Integer.parseInt(str[i]);
			max = Math.max(max,n[i]);
			min = Math.min(min,n[i]);
			sum += n[i];
		}
		System.out.println(min+" "+max+" "+sum);
	}
} Main public static void main(String[] args) throws IOException {
		int i,m,max,min;
		long sum;
		int[] n = new int[990000];
		String[] str = new String[990000];
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		str = in.readLine().split(" ");
		m = Integer.parseInt(str[0]);
		str = in.readLine().split(" "); 
		sum = max = min = Integer.parseInt(str[0]);
		for(i=1;i<m;i++){
			n[i] = Integer.parseInt(str[i]);
			max = Math.max(max,n[i]);
			min = Math.min(min,n[i]);
			sum += n[i];
		}
		System.out.println(min+" "+max+" "+sum);
	} main {
		int i,m,max,min;
		long sum;
		int[] n = new int[990000];
		String[] str = new String[990000];
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		str = in.readLine().split(" ");
		m = Integer.parseInt(str[0]);
		str = in.readLine().split(" "); 
		sum = max = min = Integer.parseInt(str[0]);
		for(i=1;i<m;i++){
			n[i] = Integer.parseInt(str[i]);
			max = Math.max(max,n[i]);
			min = Math.min(min,n[i]);
			sum += n[i];
		}
		System.out.println(min+" "+max+" "+sum);
	} int i i m m max max min; min long sum; sum int[] n = new int[990000]; n new int[990000] 990000 String[] str = new String[990000]; str new String[990000] 990000 BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) str = in.readLine().split(" ") str in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " m = Integer.parseInt(str[0]) m Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 str = in.readLine().split(" ") str in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " sum = max = min = Integer.parseInt(str[0]) sum max = min = Integer.parseInt(str[0]) max min = Integer.parseInt(str[0]) min Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 for(i=1;i<m;i++){
			n[i] = Integer.parseInt(str[i]);
			max = Math.max(max,n[i]);
			min = Math.min(min,n[i]);
			sum += n[i];
		} i=1; i=1 i 1 i<m i m i++ i++ i {
			n[i] = Integer.parseInt(str[i]);
			max = Math.max(max,n[i]);
			min = Math.min(min,n[i]);
			sum += n[i];
		} {
			n[i] = Integer.parseInt(str[i]);
			max = Math.max(max,n[i]);
			min = Math.min(min,n[i]);
			sum += n[i];
		} n[i] = Integer.parseInt(str[i]) n[i] n i Integer.parseInt(str[i]) Integer.parseInt Integer str[i] str i max = Math.max(max,n[i]) max Math.max(max,n[i]) Math.max Math max n[i] n i min = Math.min(min,n[i]) min Math.min(min,n[i]) Math.min Math min n[i] n i sum += n[i] sum n[i] n i 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
import java.io.*;
import java.util.Arrays;
class Main{
	public static void main(String[] args) throws IOException {
		int i,m,max,min;
		long sum;
		int[] n = new int[990000];
		String[] str = new String[990000];
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		str = in.readLine().split(" ");
		m = Integer.parseInt(str[0]);
		str = in.readLine().split(" "); 
		sum = max = min = Integer.parseInt(str[0]);
		for(i=1;i<m;i++){
			n[i] = Integer.parseInt(str[i]);
			max = Math.max(max,n[i]);
			min = Math.min(min,n[i]);
			sum += n[i];
		}
		System.out.println(min+" "+max+" "+sum);
	}
}