import java.io.*;
  
class Main{
	public static void main(String[] args) throws IOException{

		int x,
		max=-1000000,
		min=1000000,
		temp;
		long sum=0;
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		x = Integer.parseInt(br.readLine());
		String[] str = br.readLine().split(" ");

		for(int i = 0; i < x; i ++){
			temp = Integer.parseInt(str[i]);
			if(temp>max){
				max = temp;
			}
			if(temp<min){
				min = temp;
			}
		sum = sum + temp;
		}
		System.out.println(min + " " + max + " " +sum);
  	}
} import java.io.*; io.* java class Main{
	public static void main(String[] args) throws IOException{

		int x,
		max=-1000000,
		min=1000000,
		temp;
		long sum=0;
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		x = Integer.parseInt(br.readLine());
		String[] str = br.readLine().split(" ");

		for(int i = 0; i < x; i ++){
			temp = Integer.parseInt(str[i]);
			if(temp>max){
				max = temp;
			}
			if(temp<min){
				min = temp;
			}
		sum = sum + temp;
		}
		System.out.println(min + " " + max + " " +sum);
  	}
} Main public static void main(String[] args) throws IOException{

		int x,
		max=-1000000,
		min=1000000,
		temp;
		long sum=0;
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		x = Integer.parseInt(br.readLine());
		String[] str = br.readLine().split(" ");

		for(int i = 0; i < x; i ++){
			temp = Integer.parseInt(str[i]);
			if(temp>max){
				max = temp;
			}
			if(temp<min){
				min = temp;
			}
		sum = sum + temp;
		}
		System.out.println(min + " " + max + " " +sum);
  	} main {

		int x,
		max=-1000000,
		min=1000000,
		temp;
		long sum=0;
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		x = Integer.parseInt(br.readLine());
		String[] str = br.readLine().split(" ");

		for(int i = 0; i < x; i ++){
			temp = Integer.parseInt(str[i]);
			if(temp>max){
				max = temp;
			}
			if(temp<min){
				min = temp;
			}
		sum = sum + temp;
		}
		System.out.println(min + " " + max + " " +sum);
  	} int x x max=-1000000 max -1000000 1000000 min=1000000 min 1000000 temp; temp long sum=0; sum 0 BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) x = Integer.parseInt(br.readLine()) x Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String[] str = br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " for(int i = 0; i < x; i ++){
			temp = Integer.parseInt(str[i]);
			if(temp>max){
				max = temp;
			}
			if(temp<min){
				min = temp;
			}
		sum = sum + temp;
		} int i = 0; int i = 0; i 0 i < x i x i ++ i ++ i {
			temp = Integer.parseInt(str[i]);
			if(temp>max){
				max = temp;
			}
			if(temp<min){
				min = temp;
			}
		sum = sum + temp;
		} {
			temp = Integer.parseInt(str[i]);
			if(temp>max){
				max = temp;
			}
			if(temp<min){
				min = temp;
			}
		sum = sum + temp;
		} temp = Integer.parseInt(str[i]) temp Integer.parseInt(str[i]) Integer.parseInt Integer str[i] str i if(temp>max){
				max = temp;
			} temp>max temp max {
				max = temp;
			} max = temp max temp if(temp<min){
				min = temp;
			} temp<min temp min {
				min = temp;
			} min = temp min temp sum = sum + temp sum sum + temp sum temp 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.*;
  
class Main{
	public static void main(String[] args) throws IOException{

		int x,
		max=-1000000,
		min=1000000,
		temp;
		long sum=0;
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		x = Integer.parseInt(br.readLine());
		String[] str = br.readLine().split(" ");

		for(int i = 0; i < x; i ++){
			temp = Integer.parseInt(str[i]);
			if(temp>max){
				max = temp;
			}
			if(temp<min){
				min = temp;
			}
		sum = sum + temp;
		}
		System.out.println(min + " " + max + " " +sum);
  	}
}