import java.io.*;

public class Main {

  private static int n, min, max, number;
  private static long sum;

  public static void main(String[] args) throws NumberFormatException, IOException{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    n = Integer.parseInt(br.readLine());
    String[] input_numbers = br.readLine().split(" ");
    min = Integer.parseInt(input_numbers[0]);
    max = Integer.parseInt(input_numbers[0]);
    sum = 0;

    for (String input_number : input_numbers) {
      number = Integer.parseInt(input_number);
      if (min > number) {
        min = number;
      }
      if (max < number) {
        max = number;
      }
      sum += number;
    }

    System.out.println(min + " " + max + " " + sum);

  }
} import java.io.*; io.* java public class Main {

  private static int n, min, max, number;
  private static long sum;

  public static void main(String[] args) throws NumberFormatException, IOException{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    n = Integer.parseInt(br.readLine());
    String[] input_numbers = br.readLine().split(" ");
    min = Integer.parseInt(input_numbers[0]);
    max = Integer.parseInt(input_numbers[0]);
    sum = 0;

    for (String input_number : input_numbers) {
      number = Integer.parseInt(input_number);
      if (min > number) {
        min = number;
      }
      if (max < number) {
        max = number;
      }
      sum += number;
    }

    System.out.println(min + " " + max + " " + sum);

  }
} Main private static int n n min min max max number; number private static long sum; sum public static void main(String[] args) throws NumberFormatException, IOException{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    n = Integer.parseInt(br.readLine());
    String[] input_numbers = br.readLine().split(" ");
    min = Integer.parseInt(input_numbers[0]);
    max = Integer.parseInt(input_numbers[0]);
    sum = 0;

    for (String input_number : input_numbers) {
      number = Integer.parseInt(input_number);
      if (min > number) {
        min = number;
      }
      if (max < number) {
        max = number;
      }
      sum += number;
    }

    System.out.println(min + " " + max + " " + sum);

  } main {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    n = Integer.parseInt(br.readLine());
    String[] input_numbers = br.readLine().split(" ");
    min = Integer.parseInt(input_numbers[0]);
    max = Integer.parseInt(input_numbers[0]);
    sum = 0;

    for (String input_number : input_numbers) {
      number = Integer.parseInt(input_number);
      if (min > number) {
        min = number;
      }
      if (max < number) {
        max = number;
      }
      sum += number;
    }

    System.out.println(min + " " + max + " " + sum);

  } 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 String[] input_numbers = br.readLine().split(" "); input_numbers br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " min = Integer.parseInt(input_numbers[0]) min Integer.parseInt(input_numbers[0]) Integer.parseInt Integer input_numbers[0] input_numbers 0 max = Integer.parseInt(input_numbers[0]) max Integer.parseInt(input_numbers[0]) Integer.parseInt Integer input_numbers[0] input_numbers 0 sum = 0 sum 0 for (String input_number : input_numbers) {
      number = Integer.parseInt(input_number);
      if (min > number) {
        min = number;
      }
      if (max < number) {
        max = number;
      }
      sum += number;
    } String input_number input_numbers {
      number = Integer.parseInt(input_number);
      if (min > number) {
        min = number;
      }
      if (max < number) {
        max = number;
      }
      sum += number;
    } {
      number = Integer.parseInt(input_number);
      if (min > number) {
        min = number;
      }
      if (max < number) {
        max = number;
      }
      sum += number;
    } number = Integer.parseInt(input_number) number Integer.parseInt(input_number) Integer.parseInt Integer input_number if (min > number) {
        min = number;
      } min > number min number {
        min = number;
      } min = number min number if (max < number) {
        max = number;
      } max < number max number {
        max = number;
      } max = number max number sum += number sum number 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 {

  private static int n, min, max, number;
  private static long sum;

  public static void main(String[] args) throws NumberFormatException, IOException{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    n = Integer.parseInt(br.readLine());
    String[] input_numbers = br.readLine().split(" ");
    min = Integer.parseInt(input_numbers[0]);
    max = Integer.parseInt(input_numbers[0]);
    sum = 0;

    for (String input_number : input_numbers) {
      number = Integer.parseInt(input_number);
      if (min > number) {
        min = number;
      }
      if (max < number) {
        max = number;
      }
      sum += number;
    }

    System.out.println(min + " " + max + " " + sum);

  }
} public class Main {

  private static int n, min, max, number;
  private static long sum;

  public static void main(String[] args) throws NumberFormatException, IOException{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    n = Integer.parseInt(br.readLine());
    String[] input_numbers = br.readLine().split(" ");
    min = Integer.parseInt(input_numbers[0]);
    max = Integer.parseInt(input_numbers[0]);
    sum = 0;

    for (String input_number : input_numbers) {
      number = Integer.parseInt(input_number);
      if (min > number) {
        min = number;
      }
      if (max < number) {
        max = number;
      }
      sum += number;
    }

    System.out.println(min + " " + max + " " + sum);

  }
} Main
import java.io.*;

public class Main {

  private static int n, min, max, number;
  private static long sum;

  public static void main(String[] args) throws NumberFormatException, IOException{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    n = Integer.parseInt(br.readLine());
    String[] input_numbers = br.readLine().split(" ");
    min = Integer.parseInt(input_numbers[0]);
    max = Integer.parseInt(input_numbers[0]);
    sum = 0;

    for (String input_number : input_numbers) {
      number = Integer.parseInt(input_number);
      if (min > number) {
        min = number;
      }
      if (max < number) {
        max = number;
      }
      sum += number;
    }

    System.out.println(min + " " + max + " " + sum);

  }
}