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


public class Main {

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
		BufferedReader breader = new BufferedReader(
				new InputStreamReader(System.in));

		String line = breader.readLine();
		int num = Integer.valueOf(line);
		line = breader.readLine();
		String[] snum = line.split(" ");
		int max = Integer.valueOf(snum[0]);
		int min = max;
		long sum = max;
		for( int i = 1 ; i < num ; i++ ){
			int n = Integer.valueOf(snum[i]);
			if ( max < n ) {
				max = n;
			}
			if ( min > n ) {
				min = n;
			}
			sum += n;

		}
		System.out.println( min + " " + max + " " + sum);

	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.FileNotFoundException; FileNotFoundException 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 Exception {
		// TODO ?????????????????????????????????????????????
		BufferedReader breader = new BufferedReader(
				new InputStreamReader(System.in));

		String line = breader.readLine();
		int num = Integer.valueOf(line);
		line = breader.readLine();
		String[] snum = line.split(" ");
		int max = Integer.valueOf(snum[0]);
		int min = max;
		long sum = max;
		for( int i = 1 ; i < num ; i++ ){
			int n = Integer.valueOf(snum[i]);
			if ( max < n ) {
				max = n;
			}
			if ( min > n ) {
				min = n;
			}
			sum += n;

		}
		System.out.println( min + " " + max + " " + sum);

	}

} Main public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
		BufferedReader breader = new BufferedReader(
				new InputStreamReader(System.in));

		String line = breader.readLine();
		int num = Integer.valueOf(line);
		line = breader.readLine();
		String[] snum = line.split(" ");
		int max = Integer.valueOf(snum[0]);
		int min = max;
		long sum = max;
		for( int i = 1 ; i < num ; i++ ){
			int n = Integer.valueOf(snum[i]);
			if ( max < n ) {
				max = n;
			}
			if ( min > n ) {
				min = n;
			}
			sum += n;

		}
		System.out.println( min + " " + max + " " + sum);

	} main {
		// TODO ?????????????????????????????????????????????
		BufferedReader breader = new BufferedReader(
				new InputStreamReader(System.in));

		String line = breader.readLine();
		int num = Integer.valueOf(line);
		line = breader.readLine();
		String[] snum = line.split(" ");
		int max = Integer.valueOf(snum[0]);
		int min = max;
		long sum = max;
		for( int i = 1 ; i < num ; i++ ){
			int n = Integer.valueOf(snum[i]);
			if ( max < n ) {
				max = n;
			}
			if ( min > n ) {
				min = n;
			}
			sum += n;

		}
		System.out.println( min + " " + max + " " + sum);

	} BufferedReader breader = new BufferedReader(
				new InputStreamReader(System.in)); breader new BufferedReader(
				new InputStreamReader(System.in)) String line = breader.readLine(); line breader.readLine() breader.readLine breader int num = Integer.valueOf(line); num Integer.valueOf(line) Integer.valueOf Integer line line = breader.readLine() line breader.readLine() breader.readLine breader String[] snum = line.split(" "); snum line.split(" ") line.split line " " int max = Integer.valueOf(snum[0]); max Integer.valueOf(snum[0]) Integer.valueOf Integer snum[0] snum 0 int min = max; min max long sum = max; sum max for( int i = 1 ; i < num ; i++ ){
			int n = Integer.valueOf(snum[i]);
			if ( max < n ) {
				max = n;
			}
			if ( min > n ) {
				min = n;
			}
			sum += n;

		} int i = 1 ; int i = 1 ; i 1 i < num i num i++ i++ i {
			int n = Integer.valueOf(snum[i]);
			if ( max < n ) {
				max = n;
			}
			if ( min > n ) {
				min = n;
			}
			sum += n;

		} {
			int n = Integer.valueOf(snum[i]);
			if ( max < n ) {
				max = n;
			}
			if ( min > n ) {
				min = n;
			}
			sum += n;

		} int n = Integer.valueOf(snum[i]); n Integer.valueOf(snum[i]) Integer.valueOf Integer snum[i] snum i if ( max < n ) {
				max = n;
			} max < n max n {
				max = n;
			} max = n max n if ( min > n ) {
				min = n;
			} min > n min n {
				min = n;
			} min = n min n sum += n sum n 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 Exception {
		// TODO ?????????????????????????????????????????????
		BufferedReader breader = new BufferedReader(
				new InputStreamReader(System.in));

		String line = breader.readLine();
		int num = Integer.valueOf(line);
		line = breader.readLine();
		String[] snum = line.split(" ");
		int max = Integer.valueOf(snum[0]);
		int min = max;
		long sum = max;
		for( int i = 1 ; i < num ; i++ ){
			int n = Integer.valueOf(snum[i]);
			if ( max < n ) {
				max = n;
			}
			if ( min > n ) {
				min = n;
			}
			sum += n;

		}
		System.out.println( min + " " + max + " " + sum);

	}

} public class Main {

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
		BufferedReader breader = new BufferedReader(
				new InputStreamReader(System.in));

		String line = breader.readLine();
		int num = Integer.valueOf(line);
		line = breader.readLine();
		String[] snum = line.split(" ");
		int max = Integer.valueOf(snum[0]);
		int min = max;
		long sum = max;
		for( int i = 1 ; i < num ; i++ ){
			int n = Integer.valueOf(snum[i]);
			if ( max < n ) {
				max = n;
			}
			if ( min > n ) {
				min = n;
			}
			sum += n;

		}
		System.out.println( min + " " + max + " " + sum);

	}

} Main
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;


public class Main {

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
		BufferedReader breader = new BufferedReader(
				new InputStreamReader(System.in));

		String line = breader.readLine();
		int num = Integer.valueOf(line);
		line = breader.readLine();
		String[] snum = line.split(" ");
		int max = Integer.valueOf(snum[0]);
		int min = max;
		long sum = max;
		for( int i = 1 ; i < num ; i++ ){
			int n = Integer.valueOf(snum[i]);
			if ( max < n ) {
				max = n;
			}
			if ( min > n ) {
				min = n;
			}
			sum += n;

		}
		System.out.println( min + " " + max + " " + sum);

	}

}