import java.util.Scanner;

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

public class Main{
	public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		long max,min,sum = 0;
		int n = s.nextInt();
		long[] data = new long[n];
		
		for(int i = 0;i < n;i++){
			data[i] = s.nextInt();
		}
		
		max = data[0];
		min = data[0];
		for(int i = 0;i < n;i++){
			if(data[i] >= max)
				max = data[i];
			if(data[i] <= min)
				min = data[i];
			sum += data[i];
		}
		
		System.out.println(min +" "+max+" "+sum);
		
	}
}