import java.util.Scanner;
 
class Main{
public static void main(String[] args){
 
Scanner scan = new Scanner(System.in);
 
int i = scan.nextInt();
long max = -1000000, min = 1000000, sum = 0;
for(int j = 0; j <i; j++){
    long x = scan.nextLong();
    sum += x;
    if(x > max) max = x;
    if(x < min) min = x;
    }
 
 
System.out.println(min +" "+ max +" "+sum);
   }
}
     import java.util.Scanner; Scanner java.util class Main{
public static void main(String[] args){
 
Scanner scan = new Scanner(System.in);
 
int i = scan.nextInt();
long max = -1000000, min = 1000000, sum = 0;
for(int j = 0; j <i; j++){
    long x = scan.nextLong();
    sum += x;
    if(x > max) max = x;
    if(x < min) min = x;
    }
 
 
System.out.println(min +" "+ max +" "+sum);
   }
} Main public static void main(String[] args){
 
Scanner scan = new Scanner(System.in);
 
int i = scan.nextInt();
long max = -1000000, min = 1000000, sum = 0;
for(int j = 0; j <i; j++){
    long x = scan.nextLong();
    sum += x;
    if(x > max) max = x;
    if(x < min) min = x;
    }
 
 
System.out.println(min +" "+ max +" "+sum);
   } main {
 
Scanner scan = new Scanner(System.in);
 
int i = scan.nextInt();
long max = -1000000, min = 1000000, sum = 0;
for(int j = 0; j <i; j++){
    long x = scan.nextLong();
    sum += x;
    if(x > max) max = x;
    if(x < min) min = x;
    }
 
 
System.out.println(min +" "+ max +" "+sum);
   } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int i = scan.nextInt(); i scan.nextInt() scan.nextInt scan long max = -1000000 max -1000000 1000000 min = 1000000 min 1000000 sum = 0; sum 0 for(int j = 0; j <i; j++){
    long x = scan.nextLong();
    sum += x;
    if(x > max) max = x;
    if(x < min) min = x;
    } int j = 0; int j = 0; j 0 j <i j i j++ j++ j {
    long x = scan.nextLong();
    sum += x;
    if(x > max) max = x;
    if(x < min) min = x;
    } {
    long x = scan.nextLong();
    sum += x;
    if(x > max) max = x;
    if(x < min) min = x;
    } long x = scan.nextLong(); x scan.nextLong() scan.nextLong scan sum += x sum x if(x > max) max = x; x > max x max max = x max x if(x < min) min = x; x < min x min min = x min x 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.util.Scanner;
 
class Main{
public static void main(String[] args){
 
Scanner scan = new Scanner(System.in);
 
int i = scan.nextInt();
long max = -1000000, min = 1000000, sum = 0;
for(int j = 0; j <i; j++){
    long x = scan.nextLong();
    sum += x;
    if(x > max) max = x;
    if(x < min) min = x;
    }
 
 
System.out.println(min +" "+ max +" "+sum);
   }
}
    