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

public class Main {
	public static void main(String[] args)throws IOException{
		InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);
        long y , x;
        long sum = 0;
        String input = br.readLine();
        x = Long.parseLong(input);
        String[] list = br.readLine().split(" ");
        long ma = Long.parseLong(list[0]);
        long mi = Long.parseLong(list[0]);
        for (int i = 0; i < x; i ++)
        {
        	y = Integer.parseInt(list[i]);
        	ma = Math.max(ma, y);
        	mi = Math.min(mi, y);
        	sum += y;
        }	
        System.out.println(mi +" " +  ma +" " + sum);
	}

} 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[] args)throws IOException{
		InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);
        long y , x;
        long sum = 0;
        String input = br.readLine();
        x = Long.parseLong(input);
        String[] list = br.readLine().split(" ");
        long ma = Long.parseLong(list[0]);
        long mi = Long.parseLong(list[0]);
        for (int i = 0; i < x; i ++)
        {
        	y = Integer.parseInt(list[i]);
        	ma = Math.max(ma, y);
        	mi = Math.min(mi, y);
        	sum += y;
        }	
        System.out.println(mi +" " +  ma +" " + sum);
	}

} Main public static void main(String[] args)throws IOException{
		InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);
        long y , x;
        long sum = 0;
        String input = br.readLine();
        x = Long.parseLong(input);
        String[] list = br.readLine().split(" ");
        long ma = Long.parseLong(list[0]);
        long mi = Long.parseLong(list[0]);
        for (int i = 0; i < x; i ++)
        {
        	y = Integer.parseInt(list[i]);
        	ma = Math.max(ma, y);
        	mi = Math.min(mi, y);
        	sum += y;
        }	
        System.out.println(mi +" " +  ma +" " + sum);
	} main {
		InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);
        long y , x;
        long sum = 0;
        String input = br.readLine();
        x = Long.parseLong(input);
        String[] list = br.readLine().split(" ");
        long ma = Long.parseLong(list[0]);
        long mi = Long.parseLong(list[0]);
        for (int i = 0; i < x; i ++)
        {
        	y = Integer.parseInt(list[i]);
        	ma = Math.max(ma, y);
        	mi = Math.min(mi, y);
        	sum += y;
        }	
        System.out.println(mi +" " +  ma +" " + sum);
	} InputStreamReader isr = new InputStreamReader(System.in); isr new InputStreamReader(System.in) BufferedReader br = new BufferedReader(isr); br new BufferedReader(isr) long y y x; x long sum = 0; sum 0 String input = br.readLine(); input br.readLine() br.readLine br x = Long.parseLong(input) x Long.parseLong(input) Long.parseLong Long input String[] list = br.readLine().split(" "); list br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " long ma = Long.parseLong(list[0]); ma Long.parseLong(list[0]) Long.parseLong Long list[0] list 0 long mi = Long.parseLong(list[0]); mi Long.parseLong(list[0]) Long.parseLong Long list[0] list 0 for (int i = 0; i < x; i ++)
        {
        	y = Integer.parseInt(list[i]);
        	ma = Math.max(ma, y);
        	mi = Math.min(mi, y);
        	sum += y;
        } int i = 0; int i = 0; i 0 i < x i x i ++ i ++ i {
        	y = Integer.parseInt(list[i]);
        	ma = Math.max(ma, y);
        	mi = Math.min(mi, y);
        	sum += y;
        } {
        	y = Integer.parseInt(list[i]);
        	ma = Math.max(ma, y);
        	mi = Math.min(mi, y);
        	sum += y;
        } y = Integer.parseInt(list[i]) y Integer.parseInt(list[i]) Integer.parseInt Integer list[i] list i ma = Math.max(ma, y) ma Math.max(ma, y) Math.max Math ma y mi = Math.min(mi, y) mi Math.min(mi, y) Math.min Math mi y sum += y sum y System.out.println(mi +" " +  ma +" " + sum) System.out.println System.out System System.out mi +" " +  ma +" " + sum " " ma mi +" " +  ma +" " + sum mi " " ma " " sum String[] args args public class Main {
	public static void main(String[] args)throws IOException{
		InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);
        long y , x;
        long sum = 0;
        String input = br.readLine();
        x = Long.parseLong(input);
        String[] list = br.readLine().split(" ");
        long ma = Long.parseLong(list[0]);
        long mi = Long.parseLong(list[0]);
        for (int i = 0; i < x; i ++)
        {
        	y = Integer.parseInt(list[i]);
        	ma = Math.max(ma, y);
        	mi = Math.min(mi, y);
        	sum += y;
        }	
        System.out.println(mi +" " +  ma +" " + sum);
	}

} public class Main {
	public static void main(String[] args)throws IOException{
		InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);
        long y , x;
        long sum = 0;
        String input = br.readLine();
        x = Long.parseLong(input);
        String[] list = br.readLine().split(" ");
        long ma = Long.parseLong(list[0]);
        long mi = Long.parseLong(list[0]);
        for (int i = 0; i < x; i ++)
        {
        	y = Integer.parseInt(list[i]);
        	ma = Math.max(ma, y);
        	mi = Math.min(mi, y);
        	sum += y;
        }	
        System.out.println(mi +" " +  ma +" " + sum);
	}

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

public class Main {
	public static void main(String[] args)throws IOException{
		InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);
        long y , x;
        long sum = 0;
        String input = br.readLine();
        x = Long.parseLong(input);
        String[] list = br.readLine().split(" ");
        long ma = Long.parseLong(list[0]);
        long mi = Long.parseLong(list[0]);
        for (int i = 0; i < x; i ++)
        {
        	y = Integer.parseInt(list[i]);
        	ma = Math.max(ma, y);
        	mi = Math.min(mi, y);
        	sum += y;
        }	
        System.out.println(mi +" " +  ma +" " + sum);
	}

}