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

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

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        int time = Integer.parseInt(br.readLine());
        long sum = 0;
        int max = -1000000;
        int min = 1000000;
        int num[] = new int[time];
        String[] ary = br.readLine().split(" ");
        
        for (int i = 0; i < time; i++) {
            num[i] = Integer.parseInt(ary[i]);
            sum += num[i];
            if (max < num[i]) {
                max = num[i];
            }
            
            if (min > num[i]) {
                min = num[i];
            }
        }
        
        System.out.println(min + " " + max + " " + sum);
        
    }
}