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

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		int range = Integer.parseInt(in.readLine());
		if (range < 0 || Math.pow(10, 4) < range)
			throw new RuntimeException("error:range");
		String[] nums = new String[range];
		nums = in.readLine().split(" ");
		int min = Integer.parseInt(nums[0]), max = Integer.parseInt(nums[0]);
		long sum = 0;
		for (int i = 0; i < range; i += 1) {
			max = Math.max(max, Integer.parseInt(nums[i]));
			min = Math.min(min, Integer.parseInt(nums[i]));
			if (Integer.parseInt(nums[i]) < -Math.pow(10, 6)
					|| Math.pow(10, 6) < Integer.parseInt(nums[i]))
				throw new RuntimeException("error:nums");
			sum = sum + Integer.parseInt(nums[i]);
		}
		System.out.println(min + " " + max + " " + sum);
	}
} import java.io.BufferedReader; BufferedReader 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 IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		int range = Integer.parseInt(in.readLine());
		if (range < 0 || Math.pow(10, 4) < range)
			throw new RuntimeException("error:range");
		String[] nums = new String[range];
		nums = in.readLine().split(" ");
		int min = Integer.parseInt(nums[0]), max = Integer.parseInt(nums[0]);
		long sum = 0;
		for (int i = 0; i < range; i += 1) {
			max = Math.max(max, Integer.parseInt(nums[i]));
			min = Math.min(min, Integer.parseInt(nums[i]));
			if (Integer.parseInt(nums[i]) < -Math.pow(10, 6)
					|| Math.pow(10, 6) < Integer.parseInt(nums[i]))
				throw new RuntimeException("error:nums");
			sum = sum + Integer.parseInt(nums[i]);
		}
		System.out.println(min + " " + max + " " + sum);
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		int range = Integer.parseInt(in.readLine());
		if (range < 0 || Math.pow(10, 4) < range)
			throw new RuntimeException("error:range");
		String[] nums = new String[range];
		nums = in.readLine().split(" ");
		int min = Integer.parseInt(nums[0]), max = Integer.parseInt(nums[0]);
		long sum = 0;
		for (int i = 0; i < range; i += 1) {
			max = Math.max(max, Integer.parseInt(nums[i]));
			min = Math.min(min, Integer.parseInt(nums[i]));
			if (Integer.parseInt(nums[i]) < -Math.pow(10, 6)
					|| Math.pow(10, 6) < Integer.parseInt(nums[i]))
				throw new RuntimeException("error:nums");
			sum = sum + Integer.parseInt(nums[i]);
		}
		System.out.println(min + " " + max + " " + sum);
	} main {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		int range = Integer.parseInt(in.readLine());
		if (range < 0 || Math.pow(10, 4) < range)
			throw new RuntimeException("error:range");
		String[] nums = new String[range];
		nums = in.readLine().split(" ");
		int min = Integer.parseInt(nums[0]), max = Integer.parseInt(nums[0]);
		long sum = 0;
		for (int i = 0; i < range; i += 1) {
			max = Math.max(max, Integer.parseInt(nums[i]));
			min = Math.min(min, Integer.parseInt(nums[i]));
			if (Integer.parseInt(nums[i]) < -Math.pow(10, 6)
					|| Math.pow(10, 6) < Integer.parseInt(nums[i]))
				throw new RuntimeException("error:nums");
			sum = sum + Integer.parseInt(nums[i]);
		}
		System.out.println(min + " " + max + " " + sum);
	} BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) int range = Integer.parseInt(in.readLine()); range Integer.parseInt(in.readLine()) Integer.parseInt Integer in.readLine() in.readLine in if (range < 0 || Math.pow(10, 4) < range)
			throw new RuntimeException("error:range"); range < 0 || Math.pow(10, 4) < range range < 0 range 0 Math.pow(10, 4) < range Math.pow(10, 4) Math.pow Math 10 4 range throw new RuntimeException("error:range"); new RuntimeException("error:range") String[] nums = new String[range]; nums new String[range] range nums = in.readLine().split(" ") nums in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " int min = Integer.parseInt(nums[0]) min Integer.parseInt(nums[0]) Integer.parseInt Integer nums[0] nums 0 max = Integer.parseInt(nums[0]); max Integer.parseInt(nums[0]) Integer.parseInt Integer nums[0] nums 0 long sum = 0; sum 0 for (int i = 0; i < range; i += 1) {
			max = Math.max(max, Integer.parseInt(nums[i]));
			min = Math.min(min, Integer.parseInt(nums[i]));
			if (Integer.parseInt(nums[i]) < -Math.pow(10, 6)
					|| Math.pow(10, 6) < Integer.parseInt(nums[i]))
				throw new RuntimeException("error:nums");
			sum = sum + Integer.parseInt(nums[i]);
		} int i = 0; int i = 0; i 0 i < range i range i += 1 i += 1 i 1 {
			max = Math.max(max, Integer.parseInt(nums[i]));
			min = Math.min(min, Integer.parseInt(nums[i]));
			if (Integer.parseInt(nums[i]) < -Math.pow(10, 6)
					|| Math.pow(10, 6) < Integer.parseInt(nums[i]))
				throw new RuntimeException("error:nums");
			sum = sum + Integer.parseInt(nums[i]);
		} {
			max = Math.max(max, Integer.parseInt(nums[i]));
			min = Math.min(min, Integer.parseInt(nums[i]));
			if (Integer.parseInt(nums[i]) < -Math.pow(10, 6)
					|| Math.pow(10, 6) < Integer.parseInt(nums[i]))
				throw new RuntimeException("error:nums");
			sum = sum + Integer.parseInt(nums[i]);
		} max = Math.max(max, Integer.parseInt(nums[i])) max Math.max(max, Integer.parseInt(nums[i])) Math.max Math max Integer.parseInt(nums[i]) Integer.parseInt Integer nums[i] nums i min = Math.min(min, Integer.parseInt(nums[i])) min Math.min(min, Integer.parseInt(nums[i])) Math.min Math min Integer.parseInt(nums[i]) Integer.parseInt Integer nums[i] nums i if (Integer.parseInt(nums[i]) < -Math.pow(10, 6)
					|| Math.pow(10, 6) < Integer.parseInt(nums[i]))
				throw new RuntimeException("error:nums"); Integer.parseInt(nums[i]) < -Math.pow(10, 6)
					|| Math.pow(10, 6) < Integer.parseInt(nums[i]) Integer.parseInt(nums[i]) < -Math.pow(10, 6) Integer.parseInt(nums[i]) Integer.parseInt Integer nums[i] nums i -Math.pow(10, 6) Math.pow(10, 6) Math.pow Math 10 6 Math.pow(10, 6) < Integer.parseInt(nums[i]) Math.pow(10, 6) Math.pow Math 10 6 Integer.parseInt(nums[i]) Integer.parseInt Integer nums[i] nums i throw new RuntimeException("error:nums"); new RuntimeException("error:nums") sum = sum + Integer.parseInt(nums[i]) sum sum + Integer.parseInt(nums[i]) sum Integer.parseInt(nums[i]) Integer.parseInt Integer nums[i] nums 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) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		int range = Integer.parseInt(in.readLine());
		if (range < 0 || Math.pow(10, 4) < range)
			throw new RuntimeException("error:range");
		String[] nums = new String[range];
		nums = in.readLine().split(" ");
		int min = Integer.parseInt(nums[0]), max = Integer.parseInt(nums[0]);
		long sum = 0;
		for (int i = 0; i < range; i += 1) {
			max = Math.max(max, Integer.parseInt(nums[i]));
			min = Math.min(min, Integer.parseInt(nums[i]));
			if (Integer.parseInt(nums[i]) < -Math.pow(10, 6)
					|| Math.pow(10, 6) < Integer.parseInt(nums[i]))
				throw new RuntimeException("error:nums");
			sum = sum + Integer.parseInt(nums[i]);
		}
		System.out.println(min + " " + max + " " + sum);
	}
} public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		int range = Integer.parseInt(in.readLine());
		if (range < 0 || Math.pow(10, 4) < range)
			throw new RuntimeException("error:range");
		String[] nums = new String[range];
		nums = in.readLine().split(" ");
		int min = Integer.parseInt(nums[0]), max = Integer.parseInt(nums[0]);
		long sum = 0;
		for (int i = 0; i < range; i += 1) {
			max = Math.max(max, Integer.parseInt(nums[i]));
			min = Math.min(min, Integer.parseInt(nums[i]));
			if (Integer.parseInt(nums[i]) < -Math.pow(10, 6)
					|| Math.pow(10, 6) < Integer.parseInt(nums[i]))
				throw new RuntimeException("error:nums");
			sum = sum + Integer.parseInt(nums[i]);
		}
		System.out.println(min + " " + max + " " + sum);
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		int range = Integer.parseInt(in.readLine());
		if (range < 0 || Math.pow(10, 4) < range)
			throw new RuntimeException("error:range");
		String[] nums = new String[range];
		nums = in.readLine().split(" ");
		int min = Integer.parseInt(nums[0]), max = Integer.parseInt(nums[0]);
		long sum = 0;
		for (int i = 0; i < range; i += 1) {
			max = Math.max(max, Integer.parseInt(nums[i]));
			min = Math.min(min, Integer.parseInt(nums[i]));
			if (Integer.parseInt(nums[i]) < -Math.pow(10, 6)
					|| Math.pow(10, 6) < Integer.parseInt(nums[i]))
				throw new RuntimeException("error:nums");
			sum = sum + Integer.parseInt(nums[i]);
		}
		System.out.println(min + " " + max + " " + sum);
	}
}