import java.util.Scanner;
import java.util.Arrays;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int x=sc.nextInt();
        int asa[] = new int[x];
        long sum = 0;
        for(int i=0;i<x;i++){
            asa[i]=sc.nextInt();
            sum +=asa[i];
        }
        Arrays.sort(asa);
        
        System.out.println(asa[0]+" "+asa[x-1]+" "+sum);
    }
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int x=sc.nextInt();
        int asa[] = new int[x];
        long sum = 0;
        for(int i=0;i<x;i++){
            asa[i]=sc.nextInt();
            sum +=asa[i];
        }
        Arrays.sort(asa);
        
        System.out.println(asa[0]+" "+asa[x-1]+" "+sum);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int x=sc.nextInt();
        int asa[] = new int[x];
        long sum = 0;
        for(int i=0;i<x;i++){
            asa[i]=sc.nextInt();
            sum +=asa[i];
        }
        Arrays.sort(asa);
        
        System.out.println(asa[0]+" "+asa[x-1]+" "+sum);
    } main {
        Scanner sc = new Scanner(System.in);
        
        int x=sc.nextInt();
        int asa[] = new int[x];
        long sum = 0;
        for(int i=0;i<x;i++){
            asa[i]=sc.nextInt();
            sum +=asa[i];
        }
        Arrays.sort(asa);
        
        System.out.println(asa[0]+" "+asa[x-1]+" "+sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int x=sc.nextInt(); x sc.nextInt() sc.nextInt sc int asa[] = new int[x]; asa new int[x] x long sum = 0; sum 0 for(int i=0;i<x;i++){
            asa[i]=sc.nextInt();
            sum +=asa[i];
        } int i=0; int i=0; i 0 i<x i x i++ i++ i {
            asa[i]=sc.nextInt();
            sum +=asa[i];
        } {
            asa[i]=sc.nextInt();
            sum +=asa[i];
        } asa[i]=sc.nextInt() asa[i] asa i sc.nextInt() sc.nextInt sc sum +=asa[i] sum asa[i] asa i Arrays.sort(asa) Arrays.sort Arrays asa System.out.println(asa[0]+" "+asa[x-1]+" "+sum) System.out.println System.out System System.out asa[0]+" "+asa[x-1]+" "+sum " " asa[x-1] asa[0]+" "+asa[x-1]+" "+sum asa[0] asa 0 " " asa[x-1] asa x-1 x 1 " " sum String[] args args public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int x=sc.nextInt();
        int asa[] = new int[x];
        long sum = 0;
        for(int i=0;i<x;i++){
            asa[i]=sc.nextInt();
            sum +=asa[i];
        }
        Arrays.sort(asa);
        
        System.out.println(asa[0]+" "+asa[x-1]+" "+sum);
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int x=sc.nextInt();
        int asa[] = new int[x];
        long sum = 0;
        for(int i=0;i<x;i++){
            asa[i]=sc.nextInt();
            sum +=asa[i];
        }
        Arrays.sort(asa);
        
        System.out.println(asa[0]+" "+asa[x-1]+" "+sum);
    }
} Main
import java.util.Scanner;
import java.util.Arrays;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int x=sc.nextInt();
        int asa[] = new int[x];
        long sum = 0;
        for(int i=0;i<x;i++){
            asa[i]=sc.nextInt();
            sum +=asa[i];
        }
        Arrays.sort(asa);
        
        System.out.println(asa[0]+" "+asa[x-1]+" "+sum);
    }
}
