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

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