import java.io.*;

class Main{
	public static void main(String args[]) throws IOException{
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(buf.readLine());
		String[] str = buf.readLine().split(" ");

		int tmp;
		int max = -1000000;
		int min = 1000000;
		long sum=0;
		for(int i=0; i< str.length; i++){
			tmp = Integer.parseInt(str[i]);
			if(tmp <= min)
				min = tmp;
			if(tmp >= max)
				max = tmp;
			sum += tmp;
		}
		System.out.println(min+" "+max+" "+sum);
	}
} import java.io.*; io.* java class Main{
	public static void main(String args[]) throws IOException{
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(buf.readLine());
		String[] str = buf.readLine().split(" ");

		int tmp;
		int max = -1000000;
		int min = 1000000;
		long sum=0;
		for(int i=0; i< str.length; i++){
			tmp = Integer.parseInt(str[i]);
			if(tmp <= min)
				min = tmp;
			if(tmp >= max)
				max = tmp;
			sum += tmp;
		}
		System.out.println(min+" "+max+" "+sum);
	}
} Main public static void main(String args[]) throws IOException{
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(buf.readLine());
		String[] str = buf.readLine().split(" ");

		int tmp;
		int max = -1000000;
		int min = 1000000;
		long sum=0;
		for(int i=0; i< str.length; i++){
			tmp = Integer.parseInt(str[i]);
			if(tmp <= min)
				min = tmp;
			if(tmp >= max)
				max = tmp;
			sum += tmp;
		}
		System.out.println(min+" "+max+" "+sum);
	} main {
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(buf.readLine());
		String[] str = buf.readLine().split(" ");

		int tmp;
		int max = -1000000;
		int min = 1000000;
		long sum=0;
		for(int i=0; i< str.length; i++){
			tmp = Integer.parseInt(str[i]);
			if(tmp <= min)
				min = tmp;
			if(tmp >= max)
				max = tmp;
			sum += tmp;
		}
		System.out.println(min+" "+max+" "+sum);
	} BufferedReader buf = new BufferedReader(new InputStreamReader(System.in)); buf new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(buf.readLine()); n Integer.parseInt(buf.readLine()) Integer.parseInt Integer buf.readLine() buf.readLine buf String[] str = buf.readLine().split(" "); str buf.readLine().split(" ") buf.readLine().split buf.readLine() buf.readLine buf " " int tmp; tmp int max = -1000000; max -1000000 1000000 int min = 1000000; min 1000000 long sum=0; sum 0 for(int i=0; i< str.length; i++){
			tmp = Integer.parseInt(str[i]);
			if(tmp <= min)
				min = tmp;
			if(tmp >= max)
				max = tmp;
			sum += tmp;
		} int i=0; int i=0; i 0 i< str.length i str.length str str.length i++ i++ i {
			tmp = Integer.parseInt(str[i]);
			if(tmp <= min)
				min = tmp;
			if(tmp >= max)
				max = tmp;
			sum += tmp;
		} {
			tmp = Integer.parseInt(str[i]);
			if(tmp <= min)
				min = tmp;
			if(tmp >= max)
				max = tmp;
			sum += tmp;
		} tmp = Integer.parseInt(str[i]) tmp Integer.parseInt(str[i]) Integer.parseInt Integer str[i] str i if(tmp <= min)
				min = tmp; tmp <= min tmp min min = tmp min tmp if(tmp >= max)
				max = tmp; tmp >= max tmp max max = tmp max tmp 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
import java.io.*;

class Main{
	public static void main(String args[]) throws IOException{
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(buf.readLine());
		String[] str = buf.readLine().split(" ");

		int tmp;
		int max = -1000000;
		int min = 1000000;
		long sum=0;
		for(int i=0; i< str.length; i++){
			tmp = Integer.parseInt(str[i]);
			if(tmp <= min)
				min = tmp;
			if(tmp >= max)
				max = tmp;
			sum += tmp;
		}
		System.out.println(min+" "+max+" "+sum);
	}
}