import java.io.IOException;
import java.util.Arrays;
import java.util.OptionalLong;
import java.util.Scanner;
import java.util.stream.LongStream;

class Main {

	public static void main(String[] args) throws IOException {

		Scanner scane = new Scanner(System.in);

		int n = scane.nextInt();

		long[] nums = new long[n];

		for(int i =0; i<n; i++){
			nums[i] = scane.nextInt();
		}

	  LongStream stream = Arrays.stream(nums);
	  LongStream stream2 = Arrays.stream(nums);
	  LongStream stream3 = Arrays.stream(nums);

	  OptionalLong min = stream.min();
	  OptionalLong max = stream2.max();
	  long total = stream3.sum();

	  System.out.println(min.getAsLong()+" "+max.getAsLong()+" "+total);

	}
} import java.io.IOException; IOException java.io import java.util.Arrays; Arrays java.util import java.util.OptionalLong; OptionalLong java.util import java.util.Scanner; Scanner java.util import java.util.stream.LongStream; LongStream java.util.stream class Main {

	public static void main(String[] args) throws IOException {

		Scanner scane = new Scanner(System.in);

		int n = scane.nextInt();

		long[] nums = new long[n];

		for(int i =0; i<n; i++){
			nums[i] = scane.nextInt();
		}

	  LongStream stream = Arrays.stream(nums);
	  LongStream stream2 = Arrays.stream(nums);
	  LongStream stream3 = Arrays.stream(nums);

	  OptionalLong min = stream.min();
	  OptionalLong max = stream2.max();
	  long total = stream3.sum();

	  System.out.println(min.getAsLong()+" "+max.getAsLong()+" "+total);

	}
} Main public static void main(String[] args) throws IOException {

		Scanner scane = new Scanner(System.in);

		int n = scane.nextInt();

		long[] nums = new long[n];

		for(int i =0; i<n; i++){
			nums[i] = scane.nextInt();
		}

	  LongStream stream = Arrays.stream(nums);
	  LongStream stream2 = Arrays.stream(nums);
	  LongStream stream3 = Arrays.stream(nums);

	  OptionalLong min = stream.min();
	  OptionalLong max = stream2.max();
	  long total = stream3.sum();

	  System.out.println(min.getAsLong()+" "+max.getAsLong()+" "+total);

	} main {

		Scanner scane = new Scanner(System.in);

		int n = scane.nextInt();

		long[] nums = new long[n];

		for(int i =0; i<n; i++){
			nums[i] = scane.nextInt();
		}

	  LongStream stream = Arrays.stream(nums);
	  LongStream stream2 = Arrays.stream(nums);
	  LongStream stream3 = Arrays.stream(nums);

	  OptionalLong min = stream.min();
	  OptionalLong max = stream2.max();
	  long total = stream3.sum();

	  System.out.println(min.getAsLong()+" "+max.getAsLong()+" "+total);

	} Scanner scane = new Scanner(System.in); scane new Scanner(System.in) int n = scane.nextInt(); n scane.nextInt() scane.nextInt scane long[] nums = new long[n]; nums new long[n] n for(int i =0; i<n; i++){
			nums[i] = scane.nextInt();
		} int i =0; int i =0; i 0 i<n i n i++ i++ i {
			nums[i] = scane.nextInt();
		} {
			nums[i] = scane.nextInt();
		} nums[i] = scane.nextInt() nums[i] nums i scane.nextInt() scane.nextInt scane LongStream stream = Arrays.stream(nums); stream Arrays.stream(nums) Arrays.stream Arrays nums LongStream stream2 = Arrays.stream(nums); stream2 Arrays.stream(nums) Arrays.stream Arrays nums LongStream stream3 = Arrays.stream(nums); stream3 Arrays.stream(nums) Arrays.stream Arrays nums OptionalLong min = stream.min(); min stream.min() stream.min stream OptionalLong max = stream2.max(); max stream2.max() stream2.max stream2 long total = stream3.sum(); total stream3.sum() stream3.sum stream3 System.out.println(min.getAsLong()+" "+max.getAsLong()+" "+total) System.out.println System.out System System.out min.getAsLong()+" "+max.getAsLong()+" "+total " " max.getAsLong() min.getAsLong()+" "+max.getAsLong()+" "+total min.getAsLong() min.getAsLong min " " max.getAsLong() max.getAsLong max " " total String[] args args
import java.io.IOException;
import java.util.Arrays;
import java.util.OptionalLong;
import java.util.Scanner;
import java.util.stream.LongStream;

class Main {

	public static void main(String[] args) throws IOException {

		Scanner scane = new Scanner(System.in);

		int n = scane.nextInt();

		long[] nums = new long[n];

		for(int i =0; i<n; i++){
			nums[i] = scane.nextInt();
		}

	  LongStream stream = Arrays.stream(nums);
	  LongStream stream2 = Arrays.stream(nums);
	  LongStream stream3 = Arrays.stream(nums);

	  OptionalLong min = stream.min();
	  OptionalLong max = stream2.max();
	  long total = stream3.sum();

	  System.out.println(min.getAsLong()+" "+max.getAsLong()+" "+total);

	}
}