import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
public class Main{
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String lineN = br.readLine();
		String[] lineA = br.readLine().split(" ");
		int n = Integer.parseInt(lineN);
		int[] a = new int[n];
		int min = Integer.parseInt(lineA[0]);
		int max = min;
		long sun = 0L;
		for(int i=0; i < a.length; i++){
			a[i] = Integer.parseInt(lineA[i]);
			sun = sun + a[i];
			if( max < a[i] ){
				max = a[i];
			}
			if( min > a[i] ){
				min = a[i];
			}
		}
		System.out.println(min + " " + max + " " + sun);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io public class Main{
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String lineN = br.readLine();
		String[] lineA = br.readLine().split(" ");
		int n = Integer.parseInt(lineN);
		int[] a = new int[n];
		int min = Integer.parseInt(lineA[0]);
		int max = min;
		long sun = 0L;
		for(int i=0; i < a.length; i++){
			a[i] = Integer.parseInt(lineA[i]);
			sun = sun + a[i];
			if( max < a[i] ){
				max = a[i];
			}
			if( min > a[i] ){
				min = a[i];
			}
		}
		System.out.println(min + " " + max + " " + sun);
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String lineN = br.readLine();
		String[] lineA = br.readLine().split(" ");
		int n = Integer.parseInt(lineN);
		int[] a = new int[n];
		int min = Integer.parseInt(lineA[0]);
		int max = min;
		long sun = 0L;
		for(int i=0; i < a.length; i++){
			a[i] = Integer.parseInt(lineA[i]);
			sun = sun + a[i];
			if( max < a[i] ){
				max = a[i];
			}
			if( min > a[i] ){
				min = a[i];
			}
		}
		System.out.println(min + " " + max + " " + sun);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String lineN = br.readLine();
		String[] lineA = br.readLine().split(" ");
		int n = Integer.parseInt(lineN);
		int[] a = new int[n];
		int min = Integer.parseInt(lineA[0]);
		int max = min;
		long sun = 0L;
		for(int i=0; i < a.length; i++){
			a[i] = Integer.parseInt(lineA[i]);
			sun = sun + a[i];
			if( max < a[i] ){
				max = a[i];
			}
			if( min > a[i] ){
				min = a[i];
			}
		}
		System.out.println(min + " " + max + " " + sun);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringBuilder sb = new StringBuilder(); sb new StringBuilder() String lineN = br.readLine(); lineN br.readLine() br.readLine br String[] lineA = br.readLine().split(" "); lineA br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int n = Integer.parseInt(lineN); n Integer.parseInt(lineN) Integer.parseInt Integer lineN int[] a = new int[n]; a new int[n] n int min = Integer.parseInt(lineA[0]); min Integer.parseInt(lineA[0]) Integer.parseInt Integer lineA[0] lineA 0 int max = min; max min long sun = 0L; sun 0L for(int i=0; i < a.length; i++){
			a[i] = Integer.parseInt(lineA[i]);
			sun = sun + a[i];
			if( max < a[i] ){
				max = a[i];
			}
			if( min > a[i] ){
				min = a[i];
			}
		} int i=0; int i=0; i 0 i < a.length i a.length a a.length i++ i++ i {
			a[i] = Integer.parseInt(lineA[i]);
			sun = sun + a[i];
			if( max < a[i] ){
				max = a[i];
			}
			if( min > a[i] ){
				min = a[i];
			}
		} {
			a[i] = Integer.parseInt(lineA[i]);
			sun = sun + a[i];
			if( max < a[i] ){
				max = a[i];
			}
			if( min > a[i] ){
				min = a[i];
			}
		} a[i] = Integer.parseInt(lineA[i]) a[i] a i Integer.parseInt(lineA[i]) Integer.parseInt Integer lineA[i] lineA i sun = sun + a[i] sun sun + a[i] sun a[i] a i if( max < a[i] ){
				max = a[i];
			} max < a[i] max a[i] a i {
				max = a[i];
			} max = a[i] max a[i] a i if( min > a[i] ){
				min = a[i];
			} min > a[i] min a[i] a i {
				min = a[i];
			} min = a[i] min a[i] a i System.out.println(min + " " + max + " " + sun) System.out.println System.out System System.out min + " " + max + " " + sun " " max min + " " + max + " " + sun min " " max " " sun String[] args args public class Main{
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String lineN = br.readLine();
		String[] lineA = br.readLine().split(" ");
		int n = Integer.parseInt(lineN);
		int[] a = new int[n];
		int min = Integer.parseInt(lineA[0]);
		int max = min;
		long sun = 0L;
		for(int i=0; i < a.length; i++){
			a[i] = Integer.parseInt(lineA[i]);
			sun = sun + a[i];
			if( max < a[i] ){
				max = a[i];
			}
			if( min > a[i] ){
				min = a[i];
			}
		}
		System.out.println(min + " " + max + " " + sun);
	}
} public class Main{
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String lineN = br.readLine();
		String[] lineA = br.readLine().split(" ");
		int n = Integer.parseInt(lineN);
		int[] a = new int[n];
		int min = Integer.parseInt(lineA[0]);
		int max = min;
		long sun = 0L;
		for(int i=0; i < a.length; i++){
			a[i] = Integer.parseInt(lineA[i]);
			sun = sun + a[i];
			if( max < a[i] ){
				max = a[i];
			}
			if( min > a[i] ){
				min = a[i];
			}
		}
		System.out.println(min + " " + max + " " + sun);
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
public class Main{
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String lineN = br.readLine();
		String[] lineA = br.readLine().split(" ");
		int n = Integer.parseInt(lineN);
		int[] a = new int[n];
		int min = Integer.parseInt(lineA[0]);
		int max = min;
		long sun = 0L;
		for(int i=0; i < a.length; i++){
			a[i] = Integer.parseInt(lineA[i]);
			sun = sun + a[i];
			if( max < a[i] ){
				max = a[i];
			}
			if( min > a[i] ){
				min = a[i];
			}
		}
		System.out.println(min + " " + max + " " + sun);
	}
}