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

public class Main {
    public static void main(String[] args)throws Exception {
    	InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);

        long n = Long.parseLong(br.readLine());
        String[] input = br.readLine().split(" ");
        long m = Long.parseLong(input[0]);
        long mm = Long.parseLong(input[0]);
        long sum = 0;
        for(int x = 0 ; x < n ; x++){
        	int a = Integer.parseInt(input[x]);
        	m = Math.max(m, a);
        	mm = Math.min(mm, a);
        	sum = sum + a;
        }
        System.out.println(mm + " " + m + " " + sum);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main(String[] args)throws Exception {
    	InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);

        long n = Long.parseLong(br.readLine());
        String[] input = br.readLine().split(" ");
        long m = Long.parseLong(input[0]);
        long mm = Long.parseLong(input[0]);
        long sum = 0;
        for(int x = 0 ; x < n ; x++){
        	int a = Integer.parseInt(input[x]);
        	m = Math.max(m, a);
        	mm = Math.min(mm, a);
        	sum = sum + a;
        }
        System.out.println(mm + " " + m + " " + sum);
    }
} Main public static void main(String[] args)throws Exception {
    	InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);

        long n = Long.parseLong(br.readLine());
        String[] input = br.readLine().split(" ");
        long m = Long.parseLong(input[0]);
        long mm = Long.parseLong(input[0]);
        long sum = 0;
        for(int x = 0 ; x < n ; x++){
        	int a = Integer.parseInt(input[x]);
        	m = Math.max(m, a);
        	mm = Math.min(mm, a);
        	sum = sum + a;
        }
        System.out.println(mm + " " + m + " " + sum);
    } main {
    	InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);

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

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

        long n = Long.parseLong(br.readLine());
        String[] input = br.readLine().split(" ");
        long m = Long.parseLong(input[0]);
        long mm = Long.parseLong(input[0]);
        long sum = 0;
        for(int x = 0 ; x < n ; x++){
        	int a = Integer.parseInt(input[x]);
        	m = Math.max(m, a);
        	mm = Math.min(mm, a);
        	sum = sum + a;
        }
        System.out.println(mm + " " + m + " " + sum);
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args)throws Exception {
    	InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);

        long n = Long.parseLong(br.readLine());
        String[] input = br.readLine().split(" ");
        long m = Long.parseLong(input[0]);
        long mm = Long.parseLong(input[0]);
        long sum = 0;
        for(int x = 0 ; x < n ; x++){
        	int a = Integer.parseInt(input[x]);
        	m = Math.max(m, a);
        	mm = Math.min(mm, a);
        	sum = sum + a;
        }
        System.out.println(mm + " " + m + " " + sum);
    }
}