import java.io.*;

class Main
{
  public static void main(String[] args) throws IOException
  {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    // input
    int quantity = Integer.parseInt(br.readLine());
    String[] str = br.readLine().split(" ");
    long min = 1000000;
    long max = -1000000;
    long sum = 0;

    for(int i = 0; i < quantity; i++){

      long value = Integer.parseInt(str[i]);

      //check
      if(min > value)
        min = value;
      if(max < value)
        max = value;
      sum += value;
    }
    // output
    System.out.println(min + " " + max + " " + sum);
  }
} import java.io.*; io.* java class Main
{
  public static void main(String[] args) throws IOException
  {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    // input
    int quantity = Integer.parseInt(br.readLine());
    String[] str = br.readLine().split(" ");
    long min = 1000000;
    long max = -1000000;
    long sum = 0;

    for(int i = 0; i < quantity; i++){

      long value = Integer.parseInt(str[i]);

      //check
      if(min > value)
        min = value;
      if(max < value)
        max = value;
      sum += value;
    }
    // output
    System.out.println(min + " " + max + " " + sum);
  }
} Main public static void main(String[] args) throws IOException
  {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    // input
    int quantity = Integer.parseInt(br.readLine());
    String[] str = br.readLine().split(" ");
    long min = 1000000;
    long max = -1000000;
    long sum = 0;

    for(int i = 0; i < quantity; i++){

      long value = Integer.parseInt(str[i]);

      //check
      if(min > value)
        min = value;
      if(max < value)
        max = value;
      sum += value;
    }
    // output
    System.out.println(min + " " + max + " " + sum);
  } main {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    // input
    int quantity = Integer.parseInt(br.readLine());
    String[] str = br.readLine().split(" ");
    long min = 1000000;
    long max = -1000000;
    long sum = 0;

    for(int i = 0; i < quantity; i++){

      long value = Integer.parseInt(str[i]);

      //check
      if(min > value)
        min = value;
      if(max < value)
        max = value;
      sum += value;
    }
    // output
    System.out.println(min + " " + max + " " + sum);
  } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int quantity = Integer.parseInt(br.readLine()); quantity Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String[] str = br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " long min = 1000000; min 1000000 long max = -1000000; max -1000000 1000000 long sum = 0; sum 0 for(int i = 0; i < quantity; i++){

      long value = Integer.parseInt(str[i]);

      //check
      if(min > value)
        min = value;
      if(max < value)
        max = value;
      sum += value;
    } int i = 0; int i = 0; i 0 i < quantity i quantity i++ i++ i {

      long value = Integer.parseInt(str[i]);

      //check
      if(min > value)
        min = value;
      if(max < value)
        max = value;
      sum += value;
    } {

      long value = Integer.parseInt(str[i]);

      //check
      if(min > value)
        min = value;
      if(max < value)
        max = value;
      sum += value;
    } long value = Integer.parseInt(str[i]); value Integer.parseInt(str[i]) Integer.parseInt Integer str[i] str i if(min > value)
        min = value; min > value min value min = value min value if(max < value)
        max = value; max < value max value max = value max value sum += value sum value 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 IOException
  {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    // input
    int quantity = Integer.parseInt(br.readLine());
    String[] str = br.readLine().split(" ");
    long min = 1000000;
    long max = -1000000;
    long sum = 0;

    for(int i = 0; i < quantity; i++){

      long value = Integer.parseInt(str[i]);

      //check
      if(min > value)
        min = value;
      if(max < value)
        max = value;
      sum += value;
    }
    // output
    System.out.println(min + " " + max + " " + sum);
  }
}