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 i = Integer.parseInt(br.readLine());

		int [] su = new int[i];

		String str = br.readLine();
		String[] s = str.split(" ");

		for(int n = 0; n < i; n++){
			su[n] = Integer.parseInt(s[n]);
		}

		int max = su[0];
		int min = su[0];
		long sum = 0;

		for(int k = 0; k < su.length; k ++){
			if(max < su[k]){
				max = su[k];

			}else if (min > su[k]){
				min = su[k];
			}
			sum += su[k];
		}
		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 i = Integer.parseInt(br.readLine());

		int [] su = new int[i];

		String str = br.readLine();
		String[] s = str.split(" ");

		for(int n = 0; n < i; n++){
			su[n] = Integer.parseInt(s[n]);
		}

		int max = su[0];
		int min = su[0];
		long sum = 0;

		for(int k = 0; k < su.length; k ++){
			if(max < su[k]){
				max = su[k];

			}else if (min > su[k]){
				min = su[k];
			}
			sum += su[k];
		}
		System.out.println(min+" "+max+" "+sum);
	}
} Main public static void main(String[] args)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int i = Integer.parseInt(br.readLine());

		int [] su = new int[i];

		String str = br.readLine();
		String[] s = str.split(" ");

		for(int n = 0; n < i; n++){
			su[n] = Integer.parseInt(s[n]);
		}

		int max = su[0];
		int min = su[0];
		long sum = 0;

		for(int k = 0; k < su.length; k ++){
			if(max < su[k]){
				max = su[k];

			}else if (min > su[k]){
				min = su[k];
			}
			sum += su[k];
		}
		System.out.println(min+" "+max+" "+sum);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int i = Integer.parseInt(br.readLine());

		int [] su = new int[i];

		String str = br.readLine();
		String[] s = str.split(" ");

		for(int n = 0; n < i; n++){
			su[n] = Integer.parseInt(s[n]);
		}

		int max = su[0];
		int min = su[0];
		long sum = 0;

		for(int k = 0; k < su.length; k ++){
			if(max < su[k]){
				max = su[k];

			}else if (min > su[k]){
				min = su[k];
			}
			sum += su[k];
		}
		System.out.println(min+" "+max+" "+sum);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int i = Integer.parseInt(br.readLine()); i Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int [] su = new int[i]; su new int[i] i String str = br.readLine(); str br.readLine() br.readLine br String[] s = str.split(" "); s str.split(" ") str.split str " " for(int n = 0; n < i; n++){
			su[n] = Integer.parseInt(s[n]);
		} int n = 0; int n = 0; n 0 n < i n i n++ n++ n {
			su[n] = Integer.parseInt(s[n]);
		} {
			su[n] = Integer.parseInt(s[n]);
		} su[n] = Integer.parseInt(s[n]) su[n] su n Integer.parseInt(s[n]) Integer.parseInt Integer s[n] s n int max = su[0]; max su[0] su 0 int min = su[0]; min su[0] su 0 long sum = 0; sum 0 for(int k = 0; k < su.length; k ++){
			if(max < su[k]){
				max = su[k];

			}else if (min > su[k]){
				min = su[k];
			}
			sum += su[k];
		} int k = 0; int k = 0; k 0 k < su.length k su.length su su.length k ++ k ++ k {
			if(max < su[k]){
				max = su[k];

			}else if (min > su[k]){
				min = su[k];
			}
			sum += su[k];
		} {
			if(max < su[k]){
				max = su[k];

			}else if (min > su[k]){
				min = su[k];
			}
			sum += su[k];
		} if(max < su[k]){
				max = su[k];

			}else if (min > su[k]){
				min = su[k];
			} max < su[k] max su[k] su k {
				max = su[k];

			} max = su[k] max su[k] su k if (min > su[k]){
				min = su[k];
			} min > su[k] min su[k] su k {
				min = su[k];
			} min = su[k] min su[k] su k sum += su[k] sum su[k] su k 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 i = Integer.parseInt(br.readLine());

		int [] su = new int[i];

		String str = br.readLine();
		String[] s = str.split(" ");

		for(int n = 0; n < i; n++){
			su[n] = Integer.parseInt(s[n]);
		}

		int max = su[0];
		int min = su[0];
		long sum = 0;

		for(int k = 0; k < su.length; k ++){
			if(max < su[k]){
				max = su[k];

			}else if (min > su[k]){
				min = su[k];
			}
			sum += su[k];
		}
		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 i = Integer.parseInt(br.readLine());

		int [] su = new int[i];

		String str = br.readLine();
		String[] s = str.split(" ");

		for(int n = 0; n < i; n++){
			su[n] = Integer.parseInt(s[n]);
		}

		int max = su[0];
		int min = su[0];
		long sum = 0;

		for(int k = 0; k < su.length; k ++){
			if(max < su[k]){
				max = su[k];

			}else if (min > su[k]){
				min = su[k];
			}
			sum += su[k];
		}
		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 i = Integer.parseInt(br.readLine());

		int [] su = new int[i];

		String str = br.readLine();
		String[] s = str.split(" ");

		for(int n = 0; n < i; n++){
			su[n] = Integer.parseInt(s[n]);
		}

		int max = su[0];
		int min = su[0];
		long sum = 0;

		for(int k = 0; k < su.length; k ++){
			if(max < su[k]){
				max = su[k];

			}else if (min > su[k]){
				min = su[k];
			}
			sum += su[k];
		}
		System.out.println(min+" "+max+" "+sum);
	}
}