import java.util.Scanner;
import java.util.*;

public class Main{
    public static void main(String[] args){
        long sum=0;
        List<Integer> list = Collections.synchronizedList(new ArrayList<Integer>());
        Scanner sc = new Scanner(System.in);
int a =sc.nextInt();
for(int i=0;i<a;i++){
    int b=sc.nextInt();
    list.add(b);
    sum+=b;
}
System.out.println(Collections.min(list)+" "+Collections.max(list)+" "+sum);
    }
} import java.util.Scanner; Scanner java.util import java.util.*; util.* java public class Main{
    public static void main(String[] args){
        long sum=0;
        List<Integer> list = Collections.synchronizedList(new ArrayList<Integer>());
        Scanner sc = new Scanner(System.in);
int a =sc.nextInt();
for(int i=0;i<a;i++){
    int b=sc.nextInt();
    list.add(b);
    sum+=b;
}
System.out.println(Collections.min(list)+" "+Collections.max(list)+" "+sum);
    }
} Main public static void main(String[] args){
        long sum=0;
        List<Integer> list = Collections.synchronizedList(new ArrayList<Integer>());
        Scanner sc = new Scanner(System.in);
int a =sc.nextInt();
for(int i=0;i<a;i++){
    int b=sc.nextInt();
    list.add(b);
    sum+=b;
}
System.out.println(Collections.min(list)+" "+Collections.max(list)+" "+sum);
    } main {
        long sum=0;
        List<Integer> list = Collections.synchronizedList(new ArrayList<Integer>());
        Scanner sc = new Scanner(System.in);
int a =sc.nextInt();
for(int i=0;i<a;i++){
    int b=sc.nextInt();
    list.add(b);
    sum+=b;
}
System.out.println(Collections.min(list)+" "+Collections.max(list)+" "+sum);
    } long sum=0; sum 0 List<Integer> list = Collections.synchronizedList(new ArrayList<Integer>()); list Collections.synchronizedList(new ArrayList<Integer>()) Collections.synchronizedList Collections new ArrayList<Integer>() Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a =sc.nextInt(); a sc.nextInt() sc.nextInt sc for(int i=0;i<a;i++){
    int b=sc.nextInt();
    list.add(b);
    sum+=b;
} int i=0; int i=0; i 0 i<a i a i++ i++ i {
    int b=sc.nextInt();
    list.add(b);
    sum+=b;
} {
    int b=sc.nextInt();
    list.add(b);
    sum+=b;
} int b=sc.nextInt(); b sc.nextInt() sc.nextInt sc list.add(b) list.add list b sum+=b sum b System.out.println(Collections.min(list)+" "+Collections.max(list)+" "+sum) System.out.println System.out System System.out Collections.min(list)+" "+Collections.max(list)+" "+sum " " Collections.max(list) Collections.min(list)+" "+Collections.max(list)+" "+sum Collections.min(list) Collections.min Collections list " " Collections.max(list) Collections.max Collections list " " sum String[] args args public class Main{
    public static void main(String[] args){
        long sum=0;
        List<Integer> list = Collections.synchronizedList(new ArrayList<Integer>());
        Scanner sc = new Scanner(System.in);
int a =sc.nextInt();
for(int i=0;i<a;i++){
    int b=sc.nextInt();
    list.add(b);
    sum+=b;
}
System.out.println(Collections.min(list)+" "+Collections.max(list)+" "+sum);
    }
} public class Main{
    public static void main(String[] args){
        long sum=0;
        List<Integer> list = Collections.synchronizedList(new ArrayList<Integer>());
        Scanner sc = new Scanner(System.in);
int a =sc.nextInt();
for(int i=0;i<a;i++){
    int b=sc.nextInt();
    list.add(b);
    sum+=b;
}
System.out.println(Collections.min(list)+" "+Collections.max(list)+" "+sum);
    }
} Main
import java.util.Scanner;
import java.util.*;

public class Main{
    public static void main(String[] args){
        long sum=0;
        List<Integer> list = Collections.synchronizedList(new ArrayList<Integer>());
        Scanner sc = new Scanner(System.in);
int a =sc.nextInt();
for(int i=0;i<a;i++){
    int b=sc.nextInt();
    list.add(b);
    sum+=b;
}
System.out.println(Collections.min(list)+" "+Collections.max(list)+" "+sum);
    }
}
