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


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

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

}