import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

	public class Main {
	    public static void main(String[] args) throws Exception {
	        // Here your code !
	        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	        String line = br.readLine();
	        String line2 = br.readLine();
	        String[] ary = line2.split(" ");
	        long sum = 0;
	        List<Integer> list = new ArrayList<Integer>();
	        for(int i=0;i < ary.length;i++) {
	            list.add(new Integer(ary[i]));
	        }
	        Collections.sort(list);
	        for(Integer item : list) {
	            sum += item;
	        }
	        System.out.println(list.get(0) + " " + list.get(list.size() - 1) + " " + sum);
	    }
	} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.List; List java.util public class Main {
	    public static void main(String[] args) throws Exception {
	        // Here your code !
	        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	        String line = br.readLine();
	        String line2 = br.readLine();
	        String[] ary = line2.split(" ");
	        long sum = 0;
	        List<Integer> list = new ArrayList<Integer>();
	        for(int i=0;i < ary.length;i++) {
	            list.add(new Integer(ary[i]));
	        }
	        Collections.sort(list);
	        for(Integer item : list) {
	            sum += item;
	        }
	        System.out.println(list.get(0) + " " + list.get(list.size() - 1) + " " + sum);
	    }
	} Main public static void main(String[] args) throws Exception {
	        // Here your code !
	        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	        String line = br.readLine();
	        String line2 = br.readLine();
	        String[] ary = line2.split(" ");
	        long sum = 0;
	        List<Integer> list = new ArrayList<Integer>();
	        for(int i=0;i < ary.length;i++) {
	            list.add(new Integer(ary[i]));
	        }
	        Collections.sort(list);
	        for(Integer item : list) {
	            sum += item;
	        }
	        System.out.println(list.get(0) + " " + list.get(list.size() - 1) + " " + sum);
	    } main {
	        // Here your code !
	        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	        String line = br.readLine();
	        String line2 = br.readLine();
	        String[] ary = line2.split(" ");
	        long sum = 0;
	        List<Integer> list = new ArrayList<Integer>();
	        for(int i=0;i < ary.length;i++) {
	            list.add(new Integer(ary[i]));
	        }
	        Collections.sort(list);
	        for(Integer item : list) {
	            sum += item;
	        }
	        System.out.println(list.get(0) + " " + list.get(list.size() - 1) + " " + sum);
	    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String line = br.readLine(); line br.readLine() br.readLine br String line2 = br.readLine(); line2 br.readLine() br.readLine br String[] ary = line2.split(" "); ary line2.split(" ") line2.split line2 " " long sum = 0; sum 0 List<Integer> list = new ArrayList<Integer>(); list new ArrayList<Integer>() for(int i=0;i < ary.length;i++) {
	            list.add(new Integer(ary[i]));
	        } int i=0; int i=0; i 0 i < ary.length i ary.length ary ary.length i++ i++ i {
	            list.add(new Integer(ary[i]));
	        } {
	            list.add(new Integer(ary[i]));
	        } list.add(new Integer(ary[i])) list.add list new Integer(ary[i]) Collections.sort(list) Collections.sort Collections list for(Integer item : list) {
	            sum += item;
	        } Integer item list {
	            sum += item;
	        } {
	            sum += item;
	        } sum += item sum item System.out.println(list.get(0) + " " + list.get(list.size() - 1) + " " + sum) System.out.println System.out System System.out list.get(0) + " " + list.get(list.size() - 1) + " " + sum " " list.get(list.size() - 1) list.get(0) + " " + list.get(list.size() - 1) + " " + sum list.get(0) list.get list 0 " " list.get(list.size() - 1) list.get list list.size() - 1 list.size() list.size list 1 " " sum String[] args args public class Main {
	    public static void main(String[] args) throws Exception {
	        // Here your code !
	        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	        String line = br.readLine();
	        String line2 = br.readLine();
	        String[] ary = line2.split(" ");
	        long sum = 0;
	        List<Integer> list = new ArrayList<Integer>();
	        for(int i=0;i < ary.length;i++) {
	            list.add(new Integer(ary[i]));
	        }
	        Collections.sort(list);
	        for(Integer item : list) {
	            sum += item;
	        }
	        System.out.println(list.get(0) + " " + list.get(list.size() - 1) + " " + sum);
	    }
	} public class Main {
	    public static void main(String[] args) throws Exception {
	        // Here your code !
	        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	        String line = br.readLine();
	        String line2 = br.readLine();
	        String[] ary = line2.split(" ");
	        long sum = 0;
	        List<Integer> list = new ArrayList<Integer>();
	        for(int i=0;i < ary.length;i++) {
	            list.add(new Integer(ary[i]));
	        }
	        Collections.sort(list);
	        for(Integer item : list) {
	            sum += item;
	        }
	        System.out.println(list.get(0) + " " + list.get(list.size() - 1) + " " + sum);
	    }
	} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

	public class Main {
	    public static void main(String[] args) throws Exception {
	        // Here your code !
	        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	        String line = br.readLine();
	        String line2 = br.readLine();
	        String[] ary = line2.split(" ");
	        long sum = 0;
	        List<Integer> list = new ArrayList<Integer>();
	        for(int i=0;i < ary.length;i++) {
	            list.add(new Integer(ary[i]));
	        }
	        Collections.sort(list);
	        for(Integer item : list) {
	            sum += item;
	        }
	        System.out.println(list.get(0) + " " + list.get(list.size() - 1) + " " + sum);
	    }
	}