import java.util.Scanner;
public class Main {
 
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        long sum = 0;
        long max = 0;
        long min = 0;
        int i = Integer.parseInt(scan.next());
        long[] ary = new long[i];
        for(int a=0;a<i;a++){
            ary[a]=Long.parseLong(scan.next());
            if(a==0){ 
                min=ary[a];
                max=ary[a];
            }
            sum+=ary[a];
            if(ary[a]>max) max = ary[a];
            if(min>ary[a]) min = ary[a];
        }
        System.out.println(min+" "+max+" "+sum);
        scan.close();
    }
} import java.util.Scanner; Scanner java.util public class Main {
 
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        long sum = 0;
        long max = 0;
        long min = 0;
        int i = Integer.parseInt(scan.next());
        long[] ary = new long[i];
        for(int a=0;a<i;a++){
            ary[a]=Long.parseLong(scan.next());
            if(a==0){ 
                min=ary[a];
                max=ary[a];
            }
            sum+=ary[a];
            if(ary[a]>max) max = ary[a];
            if(min>ary[a]) min = ary[a];
        }
        System.out.println(min+" "+max+" "+sum);
        scan.close();
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        long sum = 0;
        long max = 0;
        long min = 0;
        int i = Integer.parseInt(scan.next());
        long[] ary = new long[i];
        for(int a=0;a<i;a++){
            ary[a]=Long.parseLong(scan.next());
            if(a==0){ 
                min=ary[a];
                max=ary[a];
            }
            sum+=ary[a];
            if(ary[a]>max) max = ary[a];
            if(min>ary[a]) min = ary[a];
        }
        System.out.println(min+" "+max+" "+sum);
        scan.close();
    } main {
        Scanner scan = new Scanner(System.in);
        long sum = 0;
        long max = 0;
        long min = 0;
        int i = Integer.parseInt(scan.next());
        long[] ary = new long[i];
        for(int a=0;a<i;a++){
            ary[a]=Long.parseLong(scan.next());
            if(a==0){ 
                min=ary[a];
                max=ary[a];
            }
            sum+=ary[a];
            if(ary[a]>max) max = ary[a];
            if(min>ary[a]) min = ary[a];
        }
        System.out.println(min+" "+max+" "+sum);
        scan.close();
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) long sum = 0; sum 0 long max = 0; max 0 long min = 0; min 0 int i = Integer.parseInt(scan.next()); i Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan long[] ary = new long[i]; ary new long[i] i for(int a=0;a<i;a++){
            ary[a]=Long.parseLong(scan.next());
            if(a==0){ 
                min=ary[a];
                max=ary[a];
            }
            sum+=ary[a];
            if(ary[a]>max) max = ary[a];
            if(min>ary[a]) min = ary[a];
        } int a=0; int a=0; a 0 a<i a i a++ a++ a {
            ary[a]=Long.parseLong(scan.next());
            if(a==0){ 
                min=ary[a];
                max=ary[a];
            }
            sum+=ary[a];
            if(ary[a]>max) max = ary[a];
            if(min>ary[a]) min = ary[a];
        } {
            ary[a]=Long.parseLong(scan.next());
            if(a==0){ 
                min=ary[a];
                max=ary[a];
            }
            sum+=ary[a];
            if(ary[a]>max) max = ary[a];
            if(min>ary[a]) min = ary[a];
        } ary[a]=Long.parseLong(scan.next()) ary[a] ary a Long.parseLong(scan.next()) Long.parseLong Long scan.next() scan.next scan if(a==0){ 
                min=ary[a];
                max=ary[a];
            } a==0 a 0 { 
                min=ary[a];
                max=ary[a];
            } min=ary[a] min ary[a] ary a max=ary[a] max ary[a] ary a sum+=ary[a] sum ary[a] ary a if(ary[a]>max) max = ary[a]; ary[a]>max ary[a] ary a max max = ary[a] max ary[a] ary a if(min>ary[a]) min = ary[a]; min>ary[a] min ary[a] ary a min = ary[a] min ary[a] ary a System.out.println(min+" "+max+" "+sum) System.out.println System.out System System.out min+" "+max+" "+sum " " max min+" "+max+" "+sum min " " max " " sum scan.close() scan.close scan String[] args args public class Main {
 
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        long sum = 0;
        long max = 0;
        long min = 0;
        int i = Integer.parseInt(scan.next());
        long[] ary = new long[i];
        for(int a=0;a<i;a++){
            ary[a]=Long.parseLong(scan.next());
            if(a==0){ 
                min=ary[a];
                max=ary[a];
            }
            sum+=ary[a];
            if(ary[a]>max) max = ary[a];
            if(min>ary[a]) min = ary[a];
        }
        System.out.println(min+" "+max+" "+sum);
        scan.close();
    }
} public class Main {
 
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        long sum = 0;
        long max = 0;
        long min = 0;
        int i = Integer.parseInt(scan.next());
        long[] ary = new long[i];
        for(int a=0;a<i;a++){
            ary[a]=Long.parseLong(scan.next());
            if(a==0){ 
                min=ary[a];
                max=ary[a];
            }
            sum+=ary[a];
            if(ary[a]>max) max = ary[a];
            if(min>ary[a]) min = ary[a];
        }
        System.out.println(min+" "+max+" "+sum);
        scan.close();
    }
} Main
import java.util.Scanner;
public class Main {
 
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        long sum = 0;
        long max = 0;
        long min = 0;
        int i = Integer.parseInt(scan.next());
        long[] ary = new long[i];
        for(int a=0;a<i;a++){
            ary[a]=Long.parseLong(scan.next());
            if(a==0){ 
                min=ary[a];
                max=ary[a];
            }
            sum+=ary[a];
            if(ary[a]>max) max = ary[a];
            if(min>ary[a]) min = ary[a];
        }
        System.out.println(min+" "+max+" "+sum);
        scan.close();
    }
}