import java.io.*;

class Main{
    public static void main (String[ ] args) throws Exception{
        BufferedReader br = new BufferedReader (new InputStreamReader (System.in));
        
        String str = br.readLine();
        int cnt = Integer.parseInt(str);

        int min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;
        long sum = 0;
        str = br.readLine();
        String[] strArr = str.split(" ");
        for(int loop = 0; loop < cnt; loop++)
        {
            int i = Integer.parseInt(strArr[loop]);
            if(i < min)
            {
                min = i;
            }
            if(i > max)
            {
                max = i;
            }
            sum += i;
        }
        
        System.out.println(min + " " + max + " " + sum);
    }
} import java.io.*; io.* java class Main{
    public static void main (String[ ] args) throws Exception{
        BufferedReader br = new BufferedReader (new InputStreamReader (System.in));
        
        String str = br.readLine();
        int cnt = Integer.parseInt(str);

        int min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;
        long sum = 0;
        str = br.readLine();
        String[] strArr = str.split(" ");
        for(int loop = 0; loop < cnt; loop++)
        {
            int i = Integer.parseInt(strArr[loop]);
            if(i < min)
            {
                min = i;
            }
            if(i > max)
            {
                max = i;
            }
            sum += i;
        }
        
        System.out.println(min + " " + max + " " + sum);
    }
} Main public static void main (String[ ] args) throws Exception{
        BufferedReader br = new BufferedReader (new InputStreamReader (System.in));
        
        String str = br.readLine();
        int cnt = Integer.parseInt(str);

        int min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;
        long sum = 0;
        str = br.readLine();
        String[] strArr = str.split(" ");
        for(int loop = 0; loop < cnt; loop++)
        {
            int i = Integer.parseInt(strArr[loop]);
            if(i < min)
            {
                min = i;
            }
            if(i > max)
            {
                max = i;
            }
            sum += i;
        }
        
        System.out.println(min + " " + max + " " + sum);
    } main {
        BufferedReader br = new BufferedReader (new InputStreamReader (System.in));
        
        String str = br.readLine();
        int cnt = Integer.parseInt(str);

        int min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;
        long sum = 0;
        str = br.readLine();
        String[] strArr = str.split(" ");
        for(int loop = 0; loop < cnt; loop++)
        {
            int i = Integer.parseInt(strArr[loop]);
            if(i < min)
            {
                min = i;
            }
            if(i > max)
            {
                max = i;
            }
            sum += i;
        }
        
        System.out.println(min + " " + max + " " + sum);
    } BufferedReader br = new BufferedReader (new InputStreamReader (System.in)); br new BufferedReader (new InputStreamReader (System.in)) String str = br.readLine(); str br.readLine() br.readLine br int cnt = Integer.parseInt(str); cnt Integer.parseInt(str) Integer.parseInt Integer str int min = Integer.MAX_VALUE min Integer.MAX_VALUE Integer Integer.MAX_VALUE max = Integer.MIN_VALUE; max Integer.MIN_VALUE Integer Integer.MIN_VALUE long sum = 0; sum 0 str = br.readLine() str br.readLine() br.readLine br String[] strArr = str.split(" "); strArr str.split(" ") str.split str " " for(int loop = 0; loop < cnt; loop++)
        {
            int i = Integer.parseInt(strArr[loop]);
            if(i < min)
            {
                min = i;
            }
            if(i > max)
            {
                max = i;
            }
            sum += i;
        } int loop = 0; int loop = 0; loop 0 loop < cnt loop cnt loop++ loop++ loop {
            int i = Integer.parseInt(strArr[loop]);
            if(i < min)
            {
                min = i;
            }
            if(i > max)
            {
                max = i;
            }
            sum += i;
        } {
            int i = Integer.parseInt(strArr[loop]);
            if(i < min)
            {
                min = i;
            }
            if(i > max)
            {
                max = i;
            }
            sum += i;
        } int i = Integer.parseInt(strArr[loop]); i Integer.parseInt(strArr[loop]) Integer.parseInt Integer strArr[loop] strArr loop if(i < min)
            {
                min = i;
            } i < min i min {
                min = i;
            } min = i min i if(i > max)
            {
                max = i;
            } i > max i max {
                max = i;
            } max = i max i sum += i sum 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
import java.io.*;

class Main{
    public static void main (String[ ] args) throws Exception{
        BufferedReader br = new BufferedReader (new InputStreamReader (System.in));
        
        String str = br.readLine();
        int cnt = Integer.parseInt(str);

        int min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;
        long sum = 0;
        str = br.readLine();
        String[] strArr = str.split(" ");
        for(int loop = 0; loop < cnt; loop++)
        {
            int i = Integer.parseInt(strArr[loop]);
            if(i < min)
            {
                min = i;
            }
            if(i > max)
            {
                max = i;
            }
            sum += i;
        }
        
        System.out.println(min + " " + max + " " + sum);
    }
}