import java.io.IOException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {
		//キーボード入力メソッド
		Scanner sc = new Scanner(System.in);

		//入力
		int times = sc.nextInt();
		int[] ary = new int[times];
		for(int i=0; i<times; i++) {
			ary[i] = sc.nextInt();
		}

		//処理
		long max = ary[0];
		long min = ary[0];
		long sum = 0;

		for(int i=0; i<times; i++) {
			int v =ary[i];
			if(max > v) {
				max = v;
			}else if(min < v) {
				min = v;
			}
			sum = sum + v;
		}

		//出力
		System.out.println(max +" "+ min +" "+ sum);

	}

}
 import java.io.IOException; IOException java.io import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) throws IOException {
		//キーボード入力メソッド
		Scanner sc = new Scanner(System.in);

		//入力
		int times = sc.nextInt();
		int[] ary = new int[times];
		for(int i=0; i<times; i++) {
			ary[i] = sc.nextInt();
		}

		//処理
		long max = ary[0];
		long min = ary[0];
		long sum = 0;

		for(int i=0; i<times; i++) {
			int v =ary[i];
			if(max > v) {
				max = v;
			}else if(min < v) {
				min = v;
			}
			sum = sum + v;
		}

		//出力
		System.out.println(max +" "+ min +" "+ sum);

	}

} Main public static void main(String[] args) throws IOException {
		//キーボード入力メソッド
		Scanner sc = new Scanner(System.in);

		//入力
		int times = sc.nextInt();
		int[] ary = new int[times];
		for(int i=0; i<times; i++) {
			ary[i] = sc.nextInt();
		}

		//処理
		long max = ary[0];
		long min = ary[0];
		long sum = 0;

		for(int i=0; i<times; i++) {
			int v =ary[i];
			if(max > v) {
				max = v;
			}else if(min < v) {
				min = v;
			}
			sum = sum + v;
		}

		//出力
		System.out.println(max +" "+ min +" "+ sum);

	} main {
		//キーボード入力メソッド
		Scanner sc = new Scanner(System.in);

		//入力
		int times = sc.nextInt();
		int[] ary = new int[times];
		for(int i=0; i<times; i++) {
			ary[i] = sc.nextInt();
		}

		//処理
		long max = ary[0];
		long min = ary[0];
		long sum = 0;

		for(int i=0; i<times; i++) {
			int v =ary[i];
			if(max > v) {
				max = v;
			}else if(min < v) {
				min = v;
			}
			sum = sum + v;
		}

		//出力
		System.out.println(max +" "+ min +" "+ sum);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int times = sc.nextInt(); times sc.nextInt() sc.nextInt sc int[] ary = new int[times]; ary new int[times] times for(int i=0; i<times; i++) {
			ary[i] = sc.nextInt();
		} int i=0; int i=0; i 0 i<times i times i++ i++ i {
			ary[i] = sc.nextInt();
		} {
			ary[i] = sc.nextInt();
		} ary[i] = sc.nextInt() ary[i] ary i sc.nextInt() sc.nextInt sc long max = ary[0]; max ary[0] ary 0 long min = ary[0]; min ary[0] ary 0 long sum = 0; sum 0 for(int i=0; i<times; i++) {
			int v =ary[i];
			if(max > v) {
				max = v;
			}else if(min < v) {
				min = v;
			}
			sum = sum + v;
		} int i=0; int i=0; i 0 i<times i times i++ i++ i {
			int v =ary[i];
			if(max > v) {
				max = v;
			}else if(min < v) {
				min = v;
			}
			sum = sum + v;
		} {
			int v =ary[i];
			if(max > v) {
				max = v;
			}else if(min < v) {
				min = v;
			}
			sum = sum + v;
		} int v =ary[i]; v ary[i] ary i if(max > v) {
				max = v;
			}else if(min < v) {
				min = v;
			} max > v max v {
				max = v;
			} max = v max v if(min < v) {
				min = v;
			} min < v min v {
				min = v;
			} min = v min v sum = sum + v sum sum + v sum v System.out.println(max +" "+ min +" "+ sum) System.out.println System.out System System.out max +" "+ min +" "+ sum " " min max +" "+ min +" "+ sum max " " min " " sum String[] args args public class Main {

	public static void main(String[] args) throws IOException {
		//キーボード入力メソッド
		Scanner sc = new Scanner(System.in);

		//入力
		int times = sc.nextInt();
		int[] ary = new int[times];
		for(int i=0; i<times; i++) {
			ary[i] = sc.nextInt();
		}

		//処理
		long max = ary[0];
		long min = ary[0];
		long sum = 0;

		for(int i=0; i<times; i++) {
			int v =ary[i];
			if(max > v) {
				max = v;
			}else if(min < v) {
				min = v;
			}
			sum = sum + v;
		}

		//出力
		System.out.println(max +" "+ min +" "+ sum);

	}

} public class Main {

	public static void main(String[] args) throws IOException {
		//キーボード入力メソッド
		Scanner sc = new Scanner(System.in);

		//入力
		int times = sc.nextInt();
		int[] ary = new int[times];
		for(int i=0; i<times; i++) {
			ary[i] = sc.nextInt();
		}

		//処理
		long max = ary[0];
		long min = ary[0];
		long sum = 0;

		for(int i=0; i<times; i++) {
			int v =ary[i];
			if(max > v) {
				max = v;
			}else if(min < v) {
				min = v;
			}
			sum = sum + v;
		}

		//出力
		System.out.println(max +" "+ min +" "+ sum);

	}

} Main
import java.io.IOException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {
		//キーボード入力メソッド
		Scanner sc = new Scanner(System.in);

		//入力
		int times = sc.nextInt();
		int[] ary = new int[times];
		for(int i=0; i<times; i++) {
			ary[i] = sc.nextInt();
		}

		//処理
		long max = ary[0];
		long min = ary[0];
		long sum = 0;

		for(int i=0; i<times; i++) {
			int v =ary[i];
			if(max > v) {
				max = v;
			}else if(min < v) {
				min = v;
			}
			sum = sum + v;
		}

		//出力
		System.out.println(max +" "+ min +" "+ sum);

	}

}

