import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String args[]) throws IOException{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		int num = Integer.parseInt(reader.readLine());
		String data[] = reader.readLine().split(" ");
		int[] ints = new int[num];
		for(int i=0; i<num; i++){
			ints[i] = Integer.parseInt(data[i]);
		}
		int max=Integer.MIN_VALUE;
		int min=Integer.MAX_VALUE;
		long sum=0;
		
		for(int i : ints){
			if(max<i)
				max=i;
			if(min>i)
				min=i;
			sum+=i;
		}
		
		System.out.println(Integer.toString(min)+" "+Integer.toString(max)+" "+Long.toString(sum));
		
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String args[]) throws IOException{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		int num = Integer.parseInt(reader.readLine());
		String data[] = reader.readLine().split(" ");
		int[] ints = new int[num];
		for(int i=0; i<num; i++){
			ints[i] = Integer.parseInt(data[i]);
		}
		int max=Integer.MIN_VALUE;
		int min=Integer.MAX_VALUE;
		long sum=0;
		
		for(int i : ints){
			if(max<i)
				max=i;
			if(min>i)
				min=i;
			sum+=i;
		}
		
		System.out.println(Integer.toString(min)+" "+Integer.toString(max)+" "+Long.toString(sum));
		
	}
} Main public static void main(String args[]) throws IOException{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		int num = Integer.parseInt(reader.readLine());
		String data[] = reader.readLine().split(" ");
		int[] ints = new int[num];
		for(int i=0; i<num; i++){
			ints[i] = Integer.parseInt(data[i]);
		}
		int max=Integer.MIN_VALUE;
		int min=Integer.MAX_VALUE;
		long sum=0;
		
		for(int i : ints){
			if(max<i)
				max=i;
			if(min>i)
				min=i;
			sum+=i;
		}
		
		System.out.println(Integer.toString(min)+" "+Integer.toString(max)+" "+Long.toString(sum));
		
	} main {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		int num = Integer.parseInt(reader.readLine());
		String data[] = reader.readLine().split(" ");
		int[] ints = new int[num];
		for(int i=0; i<num; i++){
			ints[i] = Integer.parseInt(data[i]);
		}
		int max=Integer.MIN_VALUE;
		int min=Integer.MAX_VALUE;
		long sum=0;
		
		for(int i : ints){
			if(max<i)
				max=i;
			if(min>i)
				min=i;
			sum+=i;
		}
		
		System.out.println(Integer.toString(min)+" "+Integer.toString(max)+" "+Long.toString(sum));
		
	} BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) int num = Integer.parseInt(reader.readLine()); num Integer.parseInt(reader.readLine()) Integer.parseInt Integer reader.readLine() reader.readLine reader String data[] = reader.readLine().split(" "); data reader.readLine().split(" ") reader.readLine().split reader.readLine() reader.readLine reader " " int[] ints = new int[num]; ints new int[num] num for(int i=0; i<num; i++){
			ints[i] = Integer.parseInt(data[i]);
		} int i=0; int i=0; i 0 i<num i num i++ i++ i {
			ints[i] = Integer.parseInt(data[i]);
		} {
			ints[i] = Integer.parseInt(data[i]);
		} ints[i] = Integer.parseInt(data[i]) ints[i] ints i Integer.parseInt(data[i]) Integer.parseInt Integer data[i] data i int max=Integer.MIN_VALUE; max Integer.MIN_VALUE Integer Integer.MIN_VALUE int min=Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE long sum=0; sum 0 for(int i : ints){
			if(max<i)
				max=i;
			if(min>i)
				min=i;
			sum+=i;
		} int i ints {
			if(max<i)
				max=i;
			if(min>i)
				min=i;
			sum+=i;
		} {
			if(max<i)
				max=i;
			if(min>i)
				min=i;
			sum+=i;
		} if(max<i)
				max=i; max<i max i max=i max i if(min>i)
				min=i; min>i min i min=i min i sum+=i sum i System.out.println(Integer.toString(min)+" "+Integer.toString(max)+" "+Long.toString(sum)) System.out.println System.out System System.out Integer.toString(min)+" "+Integer.toString(max)+" "+Long.toString(sum) " " Integer.toString(max) Integer.toString(min)+" "+Integer.toString(max)+" "+Long.toString(sum) Integer.toString(min) Integer.toString Integer min " " Integer.toString(max) Integer.toString Integer max " " Long.toString(sum) Long.toString Long sum String args[] args public class Main {
	public static void main(String args[]) throws IOException{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		int num = Integer.parseInt(reader.readLine());
		String data[] = reader.readLine().split(" ");
		int[] ints = new int[num];
		for(int i=0; i<num; i++){
			ints[i] = Integer.parseInt(data[i]);
		}
		int max=Integer.MIN_VALUE;
		int min=Integer.MAX_VALUE;
		long sum=0;
		
		for(int i : ints){
			if(max<i)
				max=i;
			if(min>i)
				min=i;
			sum+=i;
		}
		
		System.out.println(Integer.toString(min)+" "+Integer.toString(max)+" "+Long.toString(sum));
		
	}
} public class Main {
	public static void main(String args[]) throws IOException{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		int num = Integer.parseInt(reader.readLine());
		String data[] = reader.readLine().split(" ");
		int[] ints = new int[num];
		for(int i=0; i<num; i++){
			ints[i] = Integer.parseInt(data[i]);
		}
		int max=Integer.MIN_VALUE;
		int min=Integer.MAX_VALUE;
		long sum=0;
		
		for(int i : ints){
			if(max<i)
				max=i;
			if(min>i)
				min=i;
			sum+=i;
		}
		
		System.out.println(Integer.toString(min)+" "+Integer.toString(max)+" "+Long.toString(sum));
		
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String args[]) throws IOException{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		int num = Integer.parseInt(reader.readLine());
		String data[] = reader.readLine().split(" ");
		int[] ints = new int[num];
		for(int i=0; i<num; i++){
			ints[i] = Integer.parseInt(data[i]);
		}
		int max=Integer.MIN_VALUE;
		int min=Integer.MAX_VALUE;
		long sum=0;
		
		for(int i : ints){
			if(max<i)
				max=i;
			if(min>i)
				min=i;
			sum+=i;
		}
		
		System.out.println(Integer.toString(min)+" "+Integer.toString(max)+" "+Long.toString(sum));
		
	}
}