import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
 
public class Main{
    public static void main(String[] args) throws IOException{
        int n,in,min,max,i;
 
        long sum = 0;
  
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  
        n = Integer.parseInt(br.readLine());
 
        min = Integer.MAX_VALUE;
        max = Integer.MIN_VALUE;
  
        String[] readLineArray = br.readLine().split(" ");
  
        for (i = 0; i < n; i++){
            in = Integer.parseInt(readLineArray[i]);
            if(in < min) min = in;
            if(in > max) max = in;
            sum += in;
        }
 
        System.out.println(min+" "+max+" "+sum);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main{
    public static void main(String[] args) throws IOException{
        int n,in,min,max,i;
 
        long sum = 0;
  
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  
        n = Integer.parseInt(br.readLine());
 
        min = Integer.MAX_VALUE;
        max = Integer.MIN_VALUE;
  
        String[] readLineArray = br.readLine().split(" ");
  
        for (i = 0; i < n; i++){
            in = Integer.parseInt(readLineArray[i]);
            if(in < min) min = in;
            if(in > max) max = in;
            sum += in;
        }
 
        System.out.println(min+" "+max+" "+sum);
    }
} Main public static void main(String[] args) throws IOException{
        int n,in,min,max,i;
 
        long sum = 0;
  
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  
        n = Integer.parseInt(br.readLine());
 
        min = Integer.MAX_VALUE;
        max = Integer.MIN_VALUE;
  
        String[] readLineArray = br.readLine().split(" ");
  
        for (i = 0; i < n; i++){
            in = Integer.parseInt(readLineArray[i]);
            if(in < min) min = in;
            if(in > max) max = in;
            sum += in;
        }
 
        System.out.println(min+" "+max+" "+sum);
    } main {
        int n,in,min,max,i;
 
        long sum = 0;
  
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  
        n = Integer.parseInt(br.readLine());
 
        min = Integer.MAX_VALUE;
        max = Integer.MIN_VALUE;
  
        String[] readLineArray = br.readLine().split(" ");
  
        for (i = 0; i < n; i++){
            in = Integer.parseInt(readLineArray[i]);
            if(in < min) min = in;
            if(in > max) max = in;
            sum += in;
        }
 
        System.out.println(min+" "+max+" "+sum);
    } int n n in in min min max max i; i long sum = 0; sum 0 BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) n = Integer.parseInt(br.readLine()) n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br min = Integer.MAX_VALUE min Integer.MAX_VALUE Integer Integer.MAX_VALUE max = Integer.MIN_VALUE max Integer.MIN_VALUE Integer Integer.MIN_VALUE String[] readLineArray = br.readLine().split(" "); readLineArray br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " for (i = 0; i < n; i++){
            in = Integer.parseInt(readLineArray[i]);
            if(in < min) min = in;
            if(in > max) max = in;
            sum += in;
        } i = 0; i = 0 i 0 i < n i n i++ i++ i {
            in = Integer.parseInt(readLineArray[i]);
            if(in < min) min = in;
            if(in > max) max = in;
            sum += in;
        } {
            in = Integer.parseInt(readLineArray[i]);
            if(in < min) min = in;
            if(in > max) max = in;
            sum += in;
        } in = Integer.parseInt(readLineArray[i]) in Integer.parseInt(readLineArray[i]) Integer.parseInt Integer readLineArray[i] readLineArray i if(in < min) min = in; in < min in min min = in min in if(in > max) max = in; in > max in max max = in max in sum += in sum in 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) throws IOException{
        int n,in,min,max,i;
 
        long sum = 0;
  
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  
        n = Integer.parseInt(br.readLine());
 
        min = Integer.MAX_VALUE;
        max = Integer.MIN_VALUE;
  
        String[] readLineArray = br.readLine().split(" ");
  
        for (i = 0; i < n; i++){
            in = Integer.parseInt(readLineArray[i]);
            if(in < min) min = in;
            if(in > max) max = in;
            sum += in;
        }
 
        System.out.println(min+" "+max+" "+sum);
    }
} public class Main{
    public static void main(String[] args) throws IOException{
        int n,in,min,max,i;
 
        long sum = 0;
  
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  
        n = Integer.parseInt(br.readLine());
 
        min = Integer.MAX_VALUE;
        max = Integer.MIN_VALUE;
  
        String[] readLineArray = br.readLine().split(" ");
  
        for (i = 0; i < n; i++){
            in = Integer.parseInt(readLineArray[i]);
            if(in < min) min = in;
            if(in > max) max = in;
            sum += in;
        }
 
        System.out.println(min+" "+max+" "+sum);
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
 
public class Main{
    public static void main(String[] args) throws IOException{
        int n,in,min,max,i;
 
        long sum = 0;
  
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  
        n = Integer.parseInt(br.readLine());
 
        min = Integer.MAX_VALUE;
        max = Integer.MIN_VALUE;
  
        String[] readLineArray = br.readLine().split(" ");
  
        for (i = 0; i < n; i++){
            in = Integer.parseInt(readLineArray[i]);
            if(in < min) min = in;
            if(in > max) max = in;
            sum += in;
        }
 
        System.out.println(min+" "+max+" "+sum);
    }
}