import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
 
 
public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String str2[] = br.readLine().split(" ");
        long sum = 0;
        int tmp = 0;
        int max = -1000000;
        int min = 1000000;
        for(int i = 0; i < n; i++){
            tmp = Integer.parseInt(str2[i]);
            if(tmp > max) max = tmp;
            if(tmp < min) min = tmp;
            sum += tmp;
        }
        System.out.println(min+" "+max+" "+sum);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.StringTokenizer; StringTokenizer java.util public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String str2[] = br.readLine().split(" ");
        long sum = 0;
        int tmp = 0;
        int max = -1000000;
        int min = 1000000;
        for(int i = 0; i < n; i++){
            tmp = Integer.parseInt(str2[i]);
            if(tmp > max) max = tmp;
            if(tmp < min) min = tmp;
            sum += tmp;
        }
        System.out.println(min+" "+max+" "+sum);
    }
} Main public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String str2[] = br.readLine().split(" ");
        long sum = 0;
        int tmp = 0;
        int max = -1000000;
        int min = 1000000;
        for(int i = 0; i < n; i++){
            tmp = Integer.parseInt(str2[i]);
            if(tmp > max) max = tmp;
            if(tmp < min) min = tmp;
            sum += tmp;
        }
        System.out.println(min+" "+max+" "+sum);
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String str2[] = br.readLine().split(" ");
        long sum = 0;
        int tmp = 0;
        int max = -1000000;
        int min = 1000000;
        for(int i = 0; i < n; i++){
            tmp = Integer.parseInt(str2[i]);
            if(tmp > max) max = tmp;
            if(tmp < min) min = tmp;
            sum += tmp;
        }
        System.out.println(min+" "+max+" "+sum);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String str2[] = br.readLine().split(" "); str2 br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " long sum = 0; sum 0 int tmp = 0; tmp 0 int max = -1000000; max -1000000 1000000 int min = 1000000; min 1000000 for(int i = 0; i < n; i++){
            tmp = Integer.parseInt(str2[i]);
            if(tmp > max) max = tmp;
            if(tmp < min) min = tmp;
            sum += tmp;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            tmp = Integer.parseInt(str2[i]);
            if(tmp > max) max = tmp;
            if(tmp < min) min = tmp;
            sum += tmp;
        } {
            tmp = Integer.parseInt(str2[i]);
            if(tmp > max) max = tmp;
            if(tmp < min) min = tmp;
            sum += tmp;
        } tmp = Integer.parseInt(str2[i]) tmp Integer.parseInt(str2[i]) Integer.parseInt Integer str2[i] str2 i if(tmp > max) max = tmp; tmp > max tmp max max = tmp max tmp if(tmp < min) min = tmp; tmp < min tmp min 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 String[] args args public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String str2[] = br.readLine().split(" ");
        long sum = 0;
        int tmp = 0;
        int max = -1000000;
        int min = 1000000;
        for(int i = 0; i < n; i++){
            tmp = Integer.parseInt(str2[i]);
            if(tmp > max) max = tmp;
            if(tmp < min) min = tmp;
            sum += tmp;
        }
        System.out.println(min+" "+max+" "+sum);
    }
} public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String str2[] = br.readLine().split(" ");
        long sum = 0;
        int tmp = 0;
        int max = -1000000;
        int min = 1000000;
        for(int i = 0; i < n; i++){
            tmp = Integer.parseInt(str2[i]);
            if(tmp > max) max = tmp;
            if(tmp < min) min = tmp;
            sum += tmp;
        }
        System.out.println(min+" "+max+" "+sum);
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
 
 
public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String str2[] = br.readLine().split(" ");
        long sum = 0;
        int tmp = 0;
        int max = -1000000;
        int min = 1000000;
        for(int i = 0; i < n; i++){
            tmp = Integer.parseInt(str2[i]);
            if(tmp > max) max = tmp;
            if(tmp < min) min = tmp;
            sum += tmp;
        }
        System.out.println(min+" "+max+" "+sum);
    }
}