import java.util.Scanner;
public class Main {
	void minmaxsum(){
		Scanner s = new Scanner(System.in);
		int i = s.nextInt();
		long max,min,sum;
		max = -1000001;
		min = 1000001;
		sum = 0;
		for(int j = 0;j < i;j++){
			int tmp = s.nextInt();
			if(max < tmp)max = tmp;
			if(min > tmp)min = tmp;
			sum+=tmp;
		}
		System.out.println(min + " " + max + " " + sum);
	}
	public static void main(String args[]){
		Main m = new Main();
		m.minmaxsum();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	void minmaxsum(){
		Scanner s = new Scanner(System.in);
		int i = s.nextInt();
		long max,min,sum;
		max = -1000001;
		min = 1000001;
		sum = 0;
		for(int j = 0;j < i;j++){
			int tmp = s.nextInt();
			if(max < tmp)max = tmp;
			if(min > tmp)min = tmp;
			sum+=tmp;
		}
		System.out.println(min + " " + max + " " + sum);
	}
	public static void main(String args[]){
		Main m = new Main();
		m.minmaxsum();
	}
} Main void minmaxsum(){
		Scanner s = new Scanner(System.in);
		int i = s.nextInt();
		long max,min,sum;
		max = -1000001;
		min = 1000001;
		sum = 0;
		for(int j = 0;j < i;j++){
			int tmp = s.nextInt();
			if(max < tmp)max = tmp;
			if(min > tmp)min = tmp;
			sum+=tmp;
		}
		System.out.println(min + " " + max + " " + sum);
	} minmaxsum {
		Scanner s = new Scanner(System.in);
		int i = s.nextInt();
		long max,min,sum;
		max = -1000001;
		min = 1000001;
		sum = 0;
		for(int j = 0;j < i;j++){
			int tmp = s.nextInt();
			if(max < tmp)max = tmp;
			if(min > tmp)min = tmp;
			sum+=tmp;
		}
		System.out.println(min + " " + max + " " + sum);
	} Scanner s = new Scanner(System.in); s new Scanner(System.in) int i = s.nextInt(); i s.nextInt() s.nextInt s long max max min min sum; sum max = -1000001 max -1000001 1000001 min = 1000001 min 1000001 sum = 0 sum 0 for(int j = 0;j < i;j++){
			int tmp = s.nextInt();
			if(max < tmp)max = tmp;
			if(min > tmp)min = tmp;
			sum+=tmp;
		} int j = 0; int j = 0; j 0 j < i j i j++ j++ j {
			int tmp = s.nextInt();
			if(max < tmp)max = tmp;
			if(min > tmp)min = tmp;
			sum+=tmp;
		} {
			int tmp = s.nextInt();
			if(max < tmp)max = tmp;
			if(min > tmp)min = tmp;
			sum+=tmp;
		} int tmp = s.nextInt(); tmp s.nextInt() s.nextInt s if(max < tmp)max = tmp; max < tmp max tmp max = tmp max tmp if(min > tmp)min = tmp; min > tmp min tmp min = tmp min tmp sum+=tmp sum tmp System.out.println(min + " " + max + " " + sum) System.out.println System.out System System.out min + " " + max + " " + sum " " max min + " " + max + " " + sum min " " max " " sum public static void main(String args[]){
		Main m = new Main();
		m.minmaxsum();
	} main {
		Main m = new Main();
		m.minmaxsum();
	} Main m = new Main(); m new Main() m.minmaxsum() m.minmaxsum m String args[] args public class Main {
	void minmaxsum(){
		Scanner s = new Scanner(System.in);
		int i = s.nextInt();
		long max,min,sum;
		max = -1000001;
		min = 1000001;
		sum = 0;
		for(int j = 0;j < i;j++){
			int tmp = s.nextInt();
			if(max < tmp)max = tmp;
			if(min > tmp)min = tmp;
			sum+=tmp;
		}
		System.out.println(min + " " + max + " " + sum);
	}
	public static void main(String args[]){
		Main m = new Main();
		m.minmaxsum();
	}
} public class Main {
	void minmaxsum(){
		Scanner s = new Scanner(System.in);
		int i = s.nextInt();
		long max,min,sum;
		max = -1000001;
		min = 1000001;
		sum = 0;
		for(int j = 0;j < i;j++){
			int tmp = s.nextInt();
			if(max < tmp)max = tmp;
			if(min > tmp)min = tmp;
			sum+=tmp;
		}
		System.out.println(min + " " + max + " " + sum);
	}
	public static void main(String args[]){
		Main m = new Main();
		m.minmaxsum();
	}
} Main
import java.util.Scanner;
public class Main {
	void minmaxsum(){
		Scanner s = new Scanner(System.in);
		int i = s.nextInt();
		long max,min,sum;
		max = -1000001;
		min = 1000001;
		sum = 0;
		for(int j = 0;j < i;j++){
			int tmp = s.nextInt();
			if(max < tmp)max = tmp;
			if(min > tmp)min = tmp;
			sum+=tmp;
		}
		System.out.println(min + " " + max + " " + sum);
	}
	public static void main(String args[]){
		Main m = new Main();
		m.minmaxsum();
	}
}