
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
	public static void main(String[] args) throws IOException{
		InputReader in = new InputReader(System.in);
		
		int n = in.readInt();
		
		int[] aArray = new int[n];
		long sum = 0;
		for (int i = 0; i < n; i++) {
			aArray[i] = in.readInt();
			sum += aArray[i];
		}
		Arrays.sort(aArray);
		
		System.out.println(aArray[0] + " " + aArray[n - 1] + " " + sum);		
	}
}
class InputReader{
	private BufferedReader br;
	private StringTokenizer buffer = null;	
	
	public InputReader(InputStream in) {
		br = new BufferedReader(new InputStreamReader(in));				
	}

	public String read() throws IOException {
		while(buffer == null || !buffer.hasMoreTokens()) {
			buffer = new StringTokenizer(br.readLine());
		}
		return buffer.nextToken();
	}
	
	public int readInt() throws IOException {
		while(buffer == null || !buffer.hasMoreTokens()) {
			buffer = new StringTokenizer(br.readLine());
		}
		return Integer.parseInt(buffer.nextToken());
	}
	
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util import java.util.StringTokenizer; StringTokenizer java.util public class Main {
	public static void main(String[] args) throws IOException{
		InputReader in = new InputReader(System.in);
		
		int n = in.readInt();
		
		int[] aArray = new int[n];
		long sum = 0;
		for (int i = 0; i < n; i++) {
			aArray[i] = in.readInt();
			sum += aArray[i];
		}
		Arrays.sort(aArray);
		
		System.out.println(aArray[0] + " " + aArray[n - 1] + " " + sum);		
	}
} Main public static void main(String[] args) throws IOException{
		InputReader in = new InputReader(System.in);
		
		int n = in.readInt();
		
		int[] aArray = new int[n];
		long sum = 0;
		for (int i = 0; i < n; i++) {
			aArray[i] = in.readInt();
			sum += aArray[i];
		}
		Arrays.sort(aArray);
		
		System.out.println(aArray[0] + " " + aArray[n - 1] + " " + sum);		
	} main {
		InputReader in = new InputReader(System.in);
		
		int n = in.readInt();
		
		int[] aArray = new int[n];
		long sum = 0;
		for (int i = 0; i < n; i++) {
			aArray[i] = in.readInt();
			sum += aArray[i];
		}
		Arrays.sort(aArray);
		
		System.out.println(aArray[0] + " " + aArray[n - 1] + " " + sum);		
	} InputReader in = new InputReader(System.in); in new InputReader(System.in) int n = in.readInt(); n in.readInt() in.readInt in int[] aArray = new int[n]; aArray new int[n] n long sum = 0; sum 0 for (int i = 0; i < n; i++) {
			aArray[i] = in.readInt();
			sum += aArray[i];
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			aArray[i] = in.readInt();
			sum += aArray[i];
		} {
			aArray[i] = in.readInt();
			sum += aArray[i];
		} aArray[i] = in.readInt() aArray[i] aArray i in.readInt() in.readInt in sum += aArray[i] sum aArray[i] aArray i Arrays.sort(aArray) Arrays.sort Arrays aArray System.out.println(aArray[0] + " " + aArray[n - 1] + " " + sum) System.out.println System.out System System.out aArray[0] + " " + aArray[n - 1] + " " + sum " " aArray[n - 1] aArray[0] + " " + aArray[n - 1] + " " + sum aArray[0] aArray 0 " " aArray[n - 1] aArray n - 1 n 1 " " sum String[] args args class InputReader{
	private BufferedReader br;
	private StringTokenizer buffer = null;	
	
	public InputReader(InputStream in) {
		br = new BufferedReader(new InputStreamReader(in));				
	}

	public String read() throws IOException {
		while(buffer == null || !buffer.hasMoreTokens()) {
			buffer = new StringTokenizer(br.readLine());
		}
		return buffer.nextToken();
	}
	
	public int readInt() throws IOException {
		while(buffer == null || !buffer.hasMoreTokens()) {
			buffer = new StringTokenizer(br.readLine());
		}
		return Integer.parseInt(buffer.nextToken());
	}
	
} InputReader private BufferedReader br; br private StringTokenizer buffer = null; buffer null public InputReader(InputStream in) {
		br = new BufferedReader(new InputStreamReader(in));				
	} InputReader {
		br = new BufferedReader(new InputStreamReader(in));				
	} br = new BufferedReader(new InputStreamReader(in)) br new BufferedReader(new InputStreamReader(in)) InputStream in in public String read() throws IOException {
		while(buffer == null || !buffer.hasMoreTokens()) {
			buffer = new StringTokenizer(br.readLine());
		}
		return buffer.nextToken();
	} read {
		while(buffer == null || !buffer.hasMoreTokens()) {
			buffer = new StringTokenizer(br.readLine());
		}
		return buffer.nextToken();
	} while(buffer == null || !buffer.hasMoreTokens()) {
			buffer = new StringTokenizer(br.readLine());
		} buffer == null || !buffer.hasMoreTokens() buffer == null buffer null !buffer.hasMoreTokens() buffer.hasMoreTokens() buffer.hasMoreTokens buffer {
			buffer = new StringTokenizer(br.readLine());
		} buffer = new StringTokenizer(br.readLine()) buffer new StringTokenizer(br.readLine()) return buffer.nextToken(); buffer.nextToken() buffer.nextToken buffer public int readInt() throws IOException {
		while(buffer == null || !buffer.hasMoreTokens()) {
			buffer = new StringTokenizer(br.readLine());
		}
		return Integer.parseInt(buffer.nextToken());
	} readInt {
		while(buffer == null || !buffer.hasMoreTokens()) {
			buffer = new StringTokenizer(br.readLine());
		}
		return Integer.parseInt(buffer.nextToken());
	} while(buffer == null || !buffer.hasMoreTokens()) {
			buffer = new StringTokenizer(br.readLine());
		} buffer == null || !buffer.hasMoreTokens() buffer == null buffer null !buffer.hasMoreTokens() buffer.hasMoreTokens() buffer.hasMoreTokens buffer {
			buffer = new StringTokenizer(br.readLine());
		} buffer = new StringTokenizer(br.readLine()) buffer new StringTokenizer(br.readLine()) return Integer.parseInt(buffer.nextToken()); Integer.parseInt(buffer.nextToken()) Integer.parseInt Integer buffer.nextToken() buffer.nextToken buffer public class Main {
	public static void main(String[] args) throws IOException{
		InputReader in = new InputReader(System.in);
		
		int n = in.readInt();
		
		int[] aArray = new int[n];
		long sum = 0;
		for (int i = 0; i < n; i++) {
			aArray[i] = in.readInt();
			sum += aArray[i];
		}
		Arrays.sort(aArray);
		
		System.out.println(aArray[0] + " " + aArray[n - 1] + " " + sum);		
	}
} public class Main {
	public static void main(String[] args) throws IOException{
		InputReader in = new InputReader(System.in);
		
		int n = in.readInt();
		
		int[] aArray = new int[n];
		long sum = 0;
		for (int i = 0; i < n; i++) {
			aArray[i] = in.readInt();
			sum += aArray[i];
		}
		Arrays.sort(aArray);
		
		System.out.println(aArray[0] + " " + aArray[n - 1] + " " + sum);		
	}
} Main

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
	public static void main(String[] args) throws IOException{
		InputReader in = new InputReader(System.in);
		
		int n = in.readInt();
		
		int[] aArray = new int[n];
		long sum = 0;
		for (int i = 0; i < n; i++) {
			aArray[i] = in.readInt();
			sum += aArray[i];
		}
		Arrays.sort(aArray);
		
		System.out.println(aArray[0] + " " + aArray[n - 1] + " " + sum);		
	}
}
class InputReader{
	private BufferedReader br;
	private StringTokenizer buffer = null;	
	
	public InputReader(InputStream in) {
		br = new BufferedReader(new InputStreamReader(in));				
	}

	public String read() throws IOException {
		while(buffer == null || !buffer.hasMoreTokens()) {
			buffer = new StringTokenizer(br.readLine());
		}
		return buffer.nextToken();
	}
	
	public int readInt() throws IOException {
		while(buffer == null || !buffer.hasMoreTokens()) {
			buffer = new StringTokenizer(br.readLine());
		}
		return Integer.parseInt(buffer.nextToken());
	}
	
}
