import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        ArrayList<Integer> set = new ArrayList<>(num);
        for(int i=0;i<num;i++){
            set.add(sc.nextInt());
        }
        GetMinMaxSum gmms = new GetMinMaxSum();
        System.out.println(gmms.min(set) + " " + gmms.max(set) + " " + gmms.sum(set));
    }
}
class GetMinMaxSum{
    long ret = 0;
    long sum(ArrayList<Integer> list){
        ret = 0;
        for(int a : list){
            ret += a;
        }
        return ret;
    }
    long max(ArrayList<Integer> list){
        Collections.sort(list);
        ret = list.get(list.size()-1);
        return ret;
    }
    long min(ArrayList<Integer> list){
        Collections.sort(list);
        ret = list.get(0);
        return ret;
    }
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        ArrayList<Integer> set = new ArrayList<>(num);
        for(int i=0;i<num;i++){
            set.add(sc.nextInt());
        }
        GetMinMaxSum gmms = new GetMinMaxSum();
        System.out.println(gmms.min(set) + " " + gmms.max(set) + " " + gmms.sum(set));
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        ArrayList<Integer> set = new ArrayList<>(num);
        for(int i=0;i<num;i++){
            set.add(sc.nextInt());
        }
        GetMinMaxSum gmms = new GetMinMaxSum();
        System.out.println(gmms.min(set) + " " + gmms.max(set) + " " + gmms.sum(set));
    } main {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        ArrayList<Integer> set = new ArrayList<>(num);
        for(int i=0;i<num;i++){
            set.add(sc.nextInt());
        }
        GetMinMaxSum gmms = new GetMinMaxSum();
        System.out.println(gmms.min(set) + " " + gmms.max(set) + " " + gmms.sum(set));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc ArrayList<Integer> set = new ArrayList<>(num); set new ArrayList<>(num) for(int i=0;i<num;i++){
            set.add(sc.nextInt());
        } int i=0; int i=0; i 0 i<num i num i++ i++ i {
            set.add(sc.nextInt());
        } {
            set.add(sc.nextInt());
        } set.add(sc.nextInt()) set.add set sc.nextInt() sc.nextInt sc GetMinMaxSum gmms = new GetMinMaxSum(); gmms new GetMinMaxSum() System.out.println(gmms.min(set) + " " + gmms.max(set) + " " + gmms.sum(set)) System.out.println System.out System System.out gmms.min(set) + " " + gmms.max(set) + " " + gmms.sum(set) " " gmms.max(set) gmms.min(set) + " " + gmms.max(set) + " " + gmms.sum(set) gmms.min(set) gmms.min gmms set " " gmms.max(set) gmms.max gmms set " " gmms.sum(set) gmms.sum gmms set String[] args args class GetMinMaxSum{
    long ret = 0;
    long sum(ArrayList<Integer> list){
        ret = 0;
        for(int a : list){
            ret += a;
        }
        return ret;
    }
    long max(ArrayList<Integer> list){
        Collections.sort(list);
        ret = list.get(list.size()-1);
        return ret;
    }
    long min(ArrayList<Integer> list){
        Collections.sort(list);
        ret = list.get(0);
        return ret;
    }
} GetMinMaxSum long ret = 0; ret 0 long sum(ArrayList<Integer> list){
        ret = 0;
        for(int a : list){
            ret += a;
        }
        return ret;
    } sum {
        ret = 0;
        for(int a : list){
            ret += a;
        }
        return ret;
    } ret = 0 ret 0 for(int a : list){
            ret += a;
        } int a list {
            ret += a;
        } {
            ret += a;
        } ret += a ret a return ret; ret ArrayList<Integer> list list long max(ArrayList<Integer> list){
        Collections.sort(list);
        ret = list.get(list.size()-1);
        return ret;
    } max {
        Collections.sort(list);
        ret = list.get(list.size()-1);
        return ret;
    } Collections.sort(list) Collections.sort Collections list ret = list.get(list.size()-1) ret list.get(list.size()-1) list.get list list.size()-1 list.size() list.size list 1 return ret; ret ArrayList<Integer> list list long min(ArrayList<Integer> list){
        Collections.sort(list);
        ret = list.get(0);
        return ret;
    } min {
        Collections.sort(list);
        ret = list.get(0);
        return ret;
    } Collections.sort(list) Collections.sort Collections list ret = list.get(0) ret list.get(0) list.get list 0 return ret; ret ArrayList<Integer> list list public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        ArrayList<Integer> set = new ArrayList<>(num);
        for(int i=0;i<num;i++){
            set.add(sc.nextInt());
        }
        GetMinMaxSum gmms = new GetMinMaxSum();
        System.out.println(gmms.min(set) + " " + gmms.max(set) + " " + gmms.sum(set));
    }
} public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        ArrayList<Integer> set = new ArrayList<>(num);
        for(int i=0;i<num;i++){
            set.add(sc.nextInt());
        }
        GetMinMaxSum gmms = new GetMinMaxSum();
        System.out.println(gmms.min(set) + " " + gmms.max(set) + " " + gmms.sum(set));
    }
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        ArrayList<Integer> set = new ArrayList<>(num);
        for(int i=0;i<num;i++){
            set.add(sc.nextInt());
        }
        GetMinMaxSum gmms = new GetMinMaxSum();
        System.out.println(gmms.min(set) + " " + gmms.max(set) + " " + gmms.sum(set));
    }
}
class GetMinMaxSum{
    long ret = 0;
    long sum(ArrayList<Integer> list){
        ret = 0;
        for(int a : list){
            ret += a;
        }
        return ret;
    }
    long max(ArrayList<Integer> list){
        Collections.sort(list);
        ret = list.get(list.size()-1);
        return ret;
    }
    long min(ArrayList<Integer> list){
        Collections.sort(list);
        ret = list.get(0);
        return ret;
    }
}