import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner (System.in);
		int amount = scan.nextInt();
		long[] num = new long[amount];
		for (int i = 0; i < amount; i++) {
			num[i] = scan.nextLong();
		}
		
		// Calculate Max
		long max = num[0];
		for (int i = 0; i < amount; i++) {
			if (num[i] >= max)
				max = num[i];
		}
		
		// Calculate min
		long min = num[0];
		for (int i = 0; i < amount; i++) {
			if (num[i] <= min)
				min = num[i];
		}
		
		// Calculate Sum
		long sum = 0;
		for (int i = 0; i < amount; i++) {
			sum += num[i];
		}
		
		System.out.println(min + " " + max + " " + sum);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner (System.in);
		int amount = scan.nextInt();
		long[] num = new long[amount];
		for (int i = 0; i < amount; i++) {
			num[i] = scan.nextLong();
		}
		
		// Calculate Max
		long max = num[0];
		for (int i = 0; i < amount; i++) {
			if (num[i] >= max)
				max = num[i];
		}
		
		// Calculate min
		long min = num[0];
		for (int i = 0; i < amount; i++) {
			if (num[i] <= min)
				min = num[i];
		}
		
		// Calculate Sum
		long sum = 0;
		for (int i = 0; i < amount; i++) {
			sum += num[i];
		}
		
		System.out.println(min + " " + max + " " + sum);
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner (System.in);
		int amount = scan.nextInt();
		long[] num = new long[amount];
		for (int i = 0; i < amount; i++) {
			num[i] = scan.nextLong();
		}
		
		// Calculate Max
		long max = num[0];
		for (int i = 0; i < amount; i++) {
			if (num[i] >= max)
				max = num[i];
		}
		
		// Calculate min
		long min = num[0];
		for (int i = 0; i < amount; i++) {
			if (num[i] <= min)
				min = num[i];
		}
		
		// Calculate Sum
		long sum = 0;
		for (int i = 0; i < amount; i++) {
			sum += num[i];
		}
		
		System.out.println(min + " " + max + " " + sum);
	} main {
		Scanner scan = new Scanner (System.in);
		int amount = scan.nextInt();
		long[] num = new long[amount];
		for (int i = 0; i < amount; i++) {
			num[i] = scan.nextLong();
		}
		
		// Calculate Max
		long max = num[0];
		for (int i = 0; i < amount; i++) {
			if (num[i] >= max)
				max = num[i];
		}
		
		// Calculate min
		long min = num[0];
		for (int i = 0; i < amount; i++) {
			if (num[i] <= min)
				min = num[i];
		}
		
		// Calculate Sum
		long sum = 0;
		for (int i = 0; i < amount; i++) {
			sum += num[i];
		}
		
		System.out.println(min + " " + max + " " + sum);
	} Scanner scan = new Scanner (System.in); scan new Scanner (System.in) int amount = scan.nextInt(); amount scan.nextInt() scan.nextInt scan long[] num = new long[amount]; num new long[amount] amount for (int i = 0; i < amount; i++) {
			num[i] = scan.nextLong();
		} int i = 0; int i = 0; i 0 i < amount i amount i++ i++ i {
			num[i] = scan.nextLong();
		} {
			num[i] = scan.nextLong();
		} num[i] = scan.nextLong() num[i] num i scan.nextLong() scan.nextLong scan long max = num[0]; max num[0] num 0 for (int i = 0; i < amount; i++) {
			if (num[i] >= max)
				max = num[i];
		} int i = 0; int i = 0; i 0 i < amount i amount i++ i++ i {
			if (num[i] >= max)
				max = num[i];
		} {
			if (num[i] >= max)
				max = num[i];
		} if (num[i] >= max)
				max = num[i]; num[i] >= max num[i] num i max max = num[i] max num[i] num i long min = num[0]; min num[0] num 0 for (int i = 0; i < amount; i++) {
			if (num[i] <= min)
				min = num[i];
		} int i = 0; int i = 0; i 0 i < amount i amount i++ i++ i {
			if (num[i] <= min)
				min = num[i];
		} {
			if (num[i] <= min)
				min = num[i];
		} if (num[i] <= min)
				min = num[i]; num[i] <= min num[i] num i min min = num[i] min num[i] num i long sum = 0; sum 0 for (int i = 0; i < amount; i++) {
			sum += num[i];
		} int i = 0; int i = 0; i 0 i < amount i amount i++ i++ i {
			sum += num[i];
		} {
			sum += num[i];
		} sum += num[i] sum num[i] num i 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) {
		Scanner scan = new Scanner (System.in);
		int amount = scan.nextInt();
		long[] num = new long[amount];
		for (int i = 0; i < amount; i++) {
			num[i] = scan.nextLong();
		}
		
		// Calculate Max
		long max = num[0];
		for (int i = 0; i < amount; i++) {
			if (num[i] >= max)
				max = num[i];
		}
		
		// Calculate min
		long min = num[0];
		for (int i = 0; i < amount; i++) {
			if (num[i] <= min)
				min = num[i];
		}
		
		// Calculate Sum
		long sum = 0;
		for (int i = 0; i < amount; i++) {
			sum += num[i];
		}
		
		System.out.println(min + " " + max + " " + sum);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner (System.in);
		int amount = scan.nextInt();
		long[] num = new long[amount];
		for (int i = 0; i < amount; i++) {
			num[i] = scan.nextLong();
		}
		
		// Calculate Max
		long max = num[0];
		for (int i = 0; i < amount; i++) {
			if (num[i] >= max)
				max = num[i];
		}
		
		// Calculate min
		long min = num[0];
		for (int i = 0; i < amount; i++) {
			if (num[i] <= min)
				min = num[i];
		}
		
		// Calculate Sum
		long sum = 0;
		for (int i = 0; i < amount; i++) {
			sum += num[i];
		}
		
		System.out.println(min + " " + max + " " + sum);
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner (System.in);
		int amount = scan.nextInt();
		long[] num = new long[amount];
		for (int i = 0; i < amount; i++) {
			num[i] = scan.nextLong();
		}
		
		// Calculate Max
		long max = num[0];
		for (int i = 0; i < amount; i++) {
			if (num[i] >= max)
				max = num[i];
		}
		
		// Calculate min
		long min = num[0];
		for (int i = 0; i < amount; i++) {
			if (num[i] <= min)
				min = num[i];
		}
		
		// Calculate Sum
		long sum = 0;
		for (int i = 0; i < amount; i++) {
			sum += num[i];
		}
		
		System.out.println(min + " " + max + " " + sum);
	}
}