import java.util.Scanner;
public class Main {

    
    public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    String str1 = in.nextLine();
    String str2;
    int num1 = Integer.parseInt(str1);
    int num2, max, min;
    max = 0;
    min = 0;
    long sum = 0;
    
    for (int i=0; i<num1; i++)
        {
        str2 = in.next();
        num2 = Integer.parseInt(str2);
        sum += num2;
        if (i == 0)
        {
        max = num2;
        min = num2;
        }else
        if (num2 > max){max = num2;}else
        if (num2 < min){min = num2;}
        }
    System.out.println(min +" "+ max +" "+ sum);
    
    }
    
} import java.util.Scanner; Scanner java.util public class Main {

    
    public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    String str1 = in.nextLine();
    String str2;
    int num1 = Integer.parseInt(str1);
    int num2, max, min;
    max = 0;
    min = 0;
    long sum = 0;
    
    for (int i=0; i<num1; i++)
        {
        str2 = in.next();
        num2 = Integer.parseInt(str2);
        sum += num2;
        if (i == 0)
        {
        max = num2;
        min = num2;
        }else
        if (num2 > max){max = num2;}else
        if (num2 < min){min = num2;}
        }
    System.out.println(min +" "+ max +" "+ sum);
    
    }
    
} Main public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    String str1 = in.nextLine();
    String str2;
    int num1 = Integer.parseInt(str1);
    int num2, max, min;
    max = 0;
    min = 0;
    long sum = 0;
    
    for (int i=0; i<num1; i++)
        {
        str2 = in.next();
        num2 = Integer.parseInt(str2);
        sum += num2;
        if (i == 0)
        {
        max = num2;
        min = num2;
        }else
        if (num2 > max){max = num2;}else
        if (num2 < min){min = num2;}
        }
    System.out.println(min +" "+ max +" "+ sum);
    
    } main {
    Scanner in = new Scanner(System.in);
    String str1 = in.nextLine();
    String str2;
    int num1 = Integer.parseInt(str1);
    int num2, max, min;
    max = 0;
    min = 0;
    long sum = 0;
    
    for (int i=0; i<num1; i++)
        {
        str2 = in.next();
        num2 = Integer.parseInt(str2);
        sum += num2;
        if (i == 0)
        {
        max = num2;
        min = num2;
        }else
        if (num2 > max){max = num2;}else
        if (num2 < min){min = num2;}
        }
    System.out.println(min +" "+ max +" "+ sum);
    
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) String str1 = in.nextLine(); str1 in.nextLine() in.nextLine in String str2; str2 int num1 = Integer.parseInt(str1); num1 Integer.parseInt(str1) Integer.parseInt Integer str1 int num2 num2 max max min; min max = 0 max 0 min = 0 min 0 long sum = 0; sum 0 for (int i=0; i<num1; i++)
        {
        str2 = in.next();
        num2 = Integer.parseInt(str2);
        sum += num2;
        if (i == 0)
        {
        max = num2;
        min = num2;
        }else
        if (num2 > max){max = num2;}else
        if (num2 < min){min = num2;}
        } int i=0; int i=0; i 0 i<num1 i num1 i++ i++ i {
        str2 = in.next();
        num2 = Integer.parseInt(str2);
        sum += num2;
        if (i == 0)
        {
        max = num2;
        min = num2;
        }else
        if (num2 > max){max = num2;}else
        if (num2 < min){min = num2;}
        } {
        str2 = in.next();
        num2 = Integer.parseInt(str2);
        sum += num2;
        if (i == 0)
        {
        max = num2;
        min = num2;
        }else
        if (num2 > max){max = num2;}else
        if (num2 < min){min = num2;}
        } str2 = in.next() str2 in.next() in.next in num2 = Integer.parseInt(str2) num2 Integer.parseInt(str2) Integer.parseInt Integer str2 sum += num2 sum num2 if (i == 0)
        {
        max = num2;
        min = num2;
        }else
        if (num2 > max){max = num2;}else
        if (num2 < min){min = num2;} i == 0 i 0 {
        max = num2;
        min = num2;
        } max = num2 max num2 min = num2 min num2 if (num2 > max){max = num2;}else
        if (num2 < min){min = num2;} num2 > max num2 max {max = num2;} max = num2 max num2 if (num2 < min){min = num2;} num2 < min num2 min {min = num2;} min = num2 min num2 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 public class Main {

    
    public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    String str1 = in.nextLine();
    String str2;
    int num1 = Integer.parseInt(str1);
    int num2, max, min;
    max = 0;
    min = 0;
    long sum = 0;
    
    for (int i=0; i<num1; i++)
        {
        str2 = in.next();
        num2 = Integer.parseInt(str2);
        sum += num2;
        if (i == 0)
        {
        max = num2;
        min = num2;
        }else
        if (num2 > max){max = num2;}else
        if (num2 < min){min = num2;}
        }
    System.out.println(min +" "+ max +" "+ sum);
    
    }
    
} public class Main {

    
    public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    String str1 = in.nextLine();
    String str2;
    int num1 = Integer.parseInt(str1);
    int num2, max, min;
    max = 0;
    min = 0;
    long sum = 0;
    
    for (int i=0; i<num1; i++)
        {
        str2 = in.next();
        num2 = Integer.parseInt(str2);
        sum += num2;
        if (i == 0)
        {
        max = num2;
        min = num2;
        }else
        if (num2 > max){max = num2;}else
        if (num2 < min){min = num2;}
        }
    System.out.println(min +" "+ max +" "+ sum);
    
    }
    
} Main
import java.util.Scanner;
public class Main {

    
    public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    String str1 = in.nextLine();
    String str2;
    int num1 = Integer.parseInt(str1);
    int num2, max, min;
    max = 0;
    min = 0;
    long sum = 0;
    
    for (int i=0; i<num1; i++)
        {
        str2 = in.next();
        num2 = Integer.parseInt(str2);
        sum += num2;
        if (i == 0)
        {
        max = num2;
        min = num2;
        }else
        if (num2 > max){max = num2;}else
        if (num2 < min){min = num2;}
        }
    System.out.println(min +" "+ max +" "+ sum);
    
    }
    
}