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

public class Main {
	public static void main(String[] age)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String ans = br.readLine();
		int a = Integer.parseInt(ans);
		String[] input = br.readLine().split(" ");
		StringBuilder sb = new StringBuilder();
		int i = 0;
		long z = 0;
		int[] you = new int[a];

		for( i=0 ; i<a ; i++ ){
			you[i] = Integer.parseInt(input[i]);
			z = z+you[i];
		}

		int x = you[0];
		int y = you[0];

		for ( i=1 ; i<a ; i++ ){
			if( you[i]>x ) x = you[i];
			if( you[i]<y ) y = you[i];
		}
		sb.append(y).append(" ").append(x).append(" ").append(z);
		System.out.println(sb);
	}
} 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[] age)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String ans = br.readLine();
		int a = Integer.parseInt(ans);
		String[] input = br.readLine().split(" ");
		StringBuilder sb = new StringBuilder();
		int i = 0;
		long z = 0;
		int[] you = new int[a];

		for( i=0 ; i<a ; i++ ){
			you[i] = Integer.parseInt(input[i]);
			z = z+you[i];
		}

		int x = you[0];
		int y = you[0];

		for ( i=1 ; i<a ; i++ ){
			if( you[i]>x ) x = you[i];
			if( you[i]<y ) y = you[i];
		}
		sb.append(y).append(" ").append(x).append(" ").append(z);
		System.out.println(sb);
	}
} Main public static void main(String[] age)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String ans = br.readLine();
		int a = Integer.parseInt(ans);
		String[] input = br.readLine().split(" ");
		StringBuilder sb = new StringBuilder();
		int i = 0;
		long z = 0;
		int[] you = new int[a];

		for( i=0 ; i<a ; i++ ){
			you[i] = Integer.parseInt(input[i]);
			z = z+you[i];
		}

		int x = you[0];
		int y = you[0];

		for ( i=1 ; i<a ; i++ ){
			if( you[i]>x ) x = you[i];
			if( you[i]<y ) y = you[i];
		}
		sb.append(y).append(" ").append(x).append(" ").append(z);
		System.out.println(sb);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String ans = br.readLine();
		int a = Integer.parseInt(ans);
		String[] input = br.readLine().split(" ");
		StringBuilder sb = new StringBuilder();
		int i = 0;
		long z = 0;
		int[] you = new int[a];

		for( i=0 ; i<a ; i++ ){
			you[i] = Integer.parseInt(input[i]);
			z = z+you[i];
		}

		int x = you[0];
		int y = you[0];

		for ( i=1 ; i<a ; i++ ){
			if( you[i]>x ) x = you[i];
			if( you[i]<y ) y = you[i];
		}
		sb.append(y).append(" ").append(x).append(" ").append(z);
		System.out.println(sb);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String ans = br.readLine(); ans br.readLine() br.readLine br int a = Integer.parseInt(ans); a Integer.parseInt(ans) Integer.parseInt Integer ans String[] input = br.readLine().split(" "); input br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " StringBuilder sb = new StringBuilder(); sb new StringBuilder() int i = 0; i 0 long z = 0; z 0 int[] you = new int[a]; you new int[a] a for( i=0 ; i<a ; i++ ){
			you[i] = Integer.parseInt(input[i]);
			z = z+you[i];
		} i=0 ; i=0 i 0 i<a i a i++ i++ i {
			you[i] = Integer.parseInt(input[i]);
			z = z+you[i];
		} {
			you[i] = Integer.parseInt(input[i]);
			z = z+you[i];
		} you[i] = Integer.parseInt(input[i]) you[i] you i Integer.parseInt(input[i]) Integer.parseInt Integer input[i] input i z = z+you[i] z z+you[i] z you[i] you i int x = you[0]; x you[0] you 0 int y = you[0]; y you[0] you 0 for ( i=1 ; i<a ; i++ ){
			if( you[i]>x ) x = you[i];
			if( you[i]<y ) y = you[i];
		} i=1 ; i=1 i 1 i<a i a i++ i++ i {
			if( you[i]>x ) x = you[i];
			if( you[i]<y ) y = you[i];
		} {
			if( you[i]>x ) x = you[i];
			if( you[i]<y ) y = you[i];
		} if( you[i]>x ) x = you[i]; you[i]>x you[i] you i x x = you[i] x you[i] you i if( you[i]<y ) y = you[i]; you[i]<y you[i] you i y y = you[i] y you[i] you i sb.append(y).append(" ").append(x).append(" ").append(z) sb.append(y).append(" ").append(x).append(" ").append sb.append(y).append(" ").append(x).append(" ") sb.append(y).append(" ").append(x).append sb.append(y).append(" ").append(x) sb.append(y).append(" ").append sb.append(y).append(" ") sb.append(y).append sb.append(y) sb.append sb y " " x " " z System.out.println(sb) System.out.println System.out System System.out sb String[] age age public class Main {
	public static void main(String[] age)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String ans = br.readLine();
		int a = Integer.parseInt(ans);
		String[] input = br.readLine().split(" ");
		StringBuilder sb = new StringBuilder();
		int i = 0;
		long z = 0;
		int[] you = new int[a];

		for( i=0 ; i<a ; i++ ){
			you[i] = Integer.parseInt(input[i]);
			z = z+you[i];
		}

		int x = you[0];
		int y = you[0];

		for ( i=1 ; i<a ; i++ ){
			if( you[i]>x ) x = you[i];
			if( you[i]<y ) y = you[i];
		}
		sb.append(y).append(" ").append(x).append(" ").append(z);
		System.out.println(sb);
	}
} public class Main {
	public static void main(String[] age)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String ans = br.readLine();
		int a = Integer.parseInt(ans);
		String[] input = br.readLine().split(" ");
		StringBuilder sb = new StringBuilder();
		int i = 0;
		long z = 0;
		int[] you = new int[a];

		for( i=0 ; i<a ; i++ ){
			you[i] = Integer.parseInt(input[i]);
			z = z+you[i];
		}

		int x = you[0];
		int y = you[0];

		for ( i=1 ; i<a ; i++ ){
			if( you[i]>x ) x = you[i];
			if( you[i]<y ) y = you[i];
		}
		sb.append(y).append(" ").append(x).append(" ").append(z);
		System.out.println(sb);
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] age)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String ans = br.readLine();
		int a = Integer.parseInt(ans);
		String[] input = br.readLine().split(" ");
		StringBuilder sb = new StringBuilder();
		int i = 0;
		long z = 0;
		int[] you = new int[a];

		for( i=0 ; i<a ; i++ ){
			you[i] = Integer.parseInt(input[i]);
			z = z+you[i];
		}

		int x = you[0];
		int y = you[0];

		for ( i=1 ; i<a ; i++ ){
			if( you[i]>x ) x = you[i];
			if( you[i]<y ) y = you[i];
		}
		sb.append(y).append(" ").append(x).append(" ").append(z);
		System.out.println(sb);
	}
}