import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;
class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		String n =scan.nextLine();
		ArrayList<Integer> list = new ArrayList<Integer>();
		int sss =1000000;
		int ddd =-1000000;
		long sum =0;
		long kazuA = 0;
		long kazuB = 0;
		while(scan.hasNextInt()){
			int x = scan.nextInt();
			list.add(x);
		}
		for(int i=0;i<list.size();i++){
			kazuA = list.get(i);
			if(kazuA < sss){
				sss = list.get(i);
			}
			if(kazuA > ddd){
				ddd = list.get(i);
			}
			sum+= list.get(i);
		} 
		System.out.println(sss+" "+ddd+" "+sum);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.*; util.* java class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		String n =scan.nextLine();
		ArrayList<Integer> list = new ArrayList<Integer>();
		int sss =1000000;
		int ddd =-1000000;
		long sum =0;
		long kazuA = 0;
		long kazuB = 0;
		while(scan.hasNextInt()){
			int x = scan.nextInt();
			list.add(x);
		}
		for(int i=0;i<list.size();i++){
			kazuA = list.get(i);
			if(kazuA < sss){
				sss = list.get(i);
			}
			if(kazuA > ddd){
				ddd = list.get(i);
			}
			sum+= list.get(i);
		} 
		System.out.println(sss+" "+ddd+" "+sum);
	}
} Main public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		String n =scan.nextLine();
		ArrayList<Integer> list = new ArrayList<Integer>();
		int sss =1000000;
		int ddd =-1000000;
		long sum =0;
		long kazuA = 0;
		long kazuB = 0;
		while(scan.hasNextInt()){
			int x = scan.nextInt();
			list.add(x);
		}
		for(int i=0;i<list.size();i++){
			kazuA = list.get(i);
			if(kazuA < sss){
				sss = list.get(i);
			}
			if(kazuA > ddd){
				ddd = list.get(i);
			}
			sum+= list.get(i);
		} 
		System.out.println(sss+" "+ddd+" "+sum);
	} main {
		Scanner scan = new Scanner(System.in);
		String n =scan.nextLine();
		ArrayList<Integer> list = new ArrayList<Integer>();
		int sss =1000000;
		int ddd =-1000000;
		long sum =0;
		long kazuA = 0;
		long kazuB = 0;
		while(scan.hasNextInt()){
			int x = scan.nextInt();
			list.add(x);
		}
		for(int i=0;i<list.size();i++){
			kazuA = list.get(i);
			if(kazuA < sss){
				sss = list.get(i);
			}
			if(kazuA > ddd){
				ddd = list.get(i);
			}
			sum+= list.get(i);
		} 
		System.out.println(sss+" "+ddd+" "+sum);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String n =scan.nextLine(); n scan.nextLine() scan.nextLine scan ArrayList<Integer> list = new ArrayList<Integer>(); list new ArrayList<Integer>() int sss =1000000; sss 1000000 int ddd =-1000000; ddd -1000000 1000000 long sum =0; sum 0 long kazuA = 0; kazuA 0 long kazuB = 0; kazuB 0 while(scan.hasNextInt()){
			int x = scan.nextInt();
			list.add(x);
		} scan.hasNextInt() scan.hasNextInt scan {
			int x = scan.nextInt();
			list.add(x);
		} int x = scan.nextInt(); x scan.nextInt() scan.nextInt scan list.add(x) list.add list x for(int i=0;i<list.size();i++){
			kazuA = list.get(i);
			if(kazuA < sss){
				sss = list.get(i);
			}
			if(kazuA > ddd){
				ddd = list.get(i);
			}
			sum+= list.get(i);
		} int i=0; int i=0; i 0 i<list.size() i list.size() list.size list i++ i++ i {
			kazuA = list.get(i);
			if(kazuA < sss){
				sss = list.get(i);
			}
			if(kazuA > ddd){
				ddd = list.get(i);
			}
			sum+= list.get(i);
		} {
			kazuA = list.get(i);
			if(kazuA < sss){
				sss = list.get(i);
			}
			if(kazuA > ddd){
				ddd = list.get(i);
			}
			sum+= list.get(i);
		} kazuA = list.get(i) kazuA list.get(i) list.get list i if(kazuA < sss){
				sss = list.get(i);
			} kazuA < sss kazuA sss {
				sss = list.get(i);
			} sss = list.get(i) sss list.get(i) list.get list i if(kazuA > ddd){
				ddd = list.get(i);
			} kazuA > ddd kazuA ddd {
				ddd = list.get(i);
			} ddd = list.get(i) ddd list.get(i) list.get list i sum+= list.get(i) sum list.get(i) list.get list i System.out.println(sss+" "+ddd+" "+sum) System.out.println System.out System System.out sss+" "+ddd+" "+sum " " ddd sss+" "+ddd+" "+sum sss " " ddd " " sum String[] args args
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;
class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		String n =scan.nextLine();
		ArrayList<Integer> list = new ArrayList<Integer>();
		int sss =1000000;
		int ddd =-1000000;
		long sum =0;
		long kazuA = 0;
		long kazuB = 0;
		while(scan.hasNextInt()){
			int x = scan.nextInt();
			list.add(x);
		}
		for(int i=0;i<list.size();i++){
			kazuA = list.get(i);
			if(kazuA < sss){
				sss = list.get(i);
			}
			if(kazuA > ddd){
				ddd = list.get(i);
			}
			sum+= list.get(i);
		} 
		System.out.println(sss+" "+ddd+" "+sum);
	}
}