import java.util.Scanner;

public class Main {

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

  public static void main(String[] args) {
    Scanner stdIn = new Scanner(System.in);
    n = stdIn.nextInt();
    input_num = stdIn.nextInt();
    max = input_num;
    min = input_num;
    sum = input_num;
    for (int i = 1;i < n; i++) {
      input_num = stdIn.nextInt();
      if(max < input_num) {
        max = input_num;
      }
      if(min > input_num) {
        min = input_num;
      }
      sum += input_num;
    }

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

  }
} import java.util.Scanner; Scanner java.util public class Main {

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

  public static void main(String[] args) {
    Scanner stdIn = new Scanner(System.in);
    n = stdIn.nextInt();
    input_num = stdIn.nextInt();
    max = input_num;
    min = input_num;
    sum = input_num;
    for (int i = 1;i < n; i++) {
      input_num = stdIn.nextInt();
      if(max < input_num) {
        max = input_num;
      }
      if(min > input_num) {
        min = input_num;
      }
      sum += input_num;
    }

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

  }
} Main private static int n n input_num input_num min min max; max private static long sum; sum public static void main(String[] args) {
    Scanner stdIn = new Scanner(System.in);
    n = stdIn.nextInt();
    input_num = stdIn.nextInt();
    max = input_num;
    min = input_num;
    sum = input_num;
    for (int i = 1;i < n; i++) {
      input_num = stdIn.nextInt();
      if(max < input_num) {
        max = input_num;
      }
      if(min > input_num) {
        min = input_num;
      }
      sum += input_num;
    }

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

  } main {
    Scanner stdIn = new Scanner(System.in);
    n = stdIn.nextInt();
    input_num = stdIn.nextInt();
    max = input_num;
    min = input_num;
    sum = input_num;
    for (int i = 1;i < n; i++) {
      input_num = stdIn.nextInt();
      if(max < input_num) {
        max = input_num;
      }
      if(min > input_num) {
        min = input_num;
      }
      sum += input_num;
    }

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

  } Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) n = stdIn.nextInt() n stdIn.nextInt() stdIn.nextInt stdIn input_num = stdIn.nextInt() input_num stdIn.nextInt() stdIn.nextInt stdIn max = input_num max input_num min = input_num min input_num sum = input_num sum input_num for (int i = 1;i < n; i++) {
      input_num = stdIn.nextInt();
      if(max < input_num) {
        max = input_num;
      }
      if(min > input_num) {
        min = input_num;
      }
      sum += input_num;
    } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
      input_num = stdIn.nextInt();
      if(max < input_num) {
        max = input_num;
      }
      if(min > input_num) {
        min = input_num;
      }
      sum += input_num;
    } {
      input_num = stdIn.nextInt();
      if(max < input_num) {
        max = input_num;
      }
      if(min > input_num) {
        min = input_num;
      }
      sum += input_num;
    } input_num = stdIn.nextInt() input_num stdIn.nextInt() stdIn.nextInt stdIn if(max < input_num) {
        max = input_num;
      } max < input_num max input_num {
        max = input_num;
      } max = input_num max input_num if(min > input_num) {
        min = input_num;
      } min > input_num min input_num {
        min = input_num;
      } min = input_num min input_num sum += input_num sum input_num 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, input_num, min, max;
  private static long sum;

  public static void main(String[] args) {
    Scanner stdIn = new Scanner(System.in);
    n = stdIn.nextInt();
    input_num = stdIn.nextInt();
    max = input_num;
    min = input_num;
    sum = input_num;
    for (int i = 1;i < n; i++) {
      input_num = stdIn.nextInt();
      if(max < input_num) {
        max = input_num;
      }
      if(min > input_num) {
        min = input_num;
      }
      sum += input_num;
    }

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

  }
} public class Main {

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

  public static void main(String[] args) {
    Scanner stdIn = new Scanner(System.in);
    n = stdIn.nextInt();
    input_num = stdIn.nextInt();
    max = input_num;
    min = input_num;
    sum = input_num;
    for (int i = 1;i < n; i++) {
      input_num = stdIn.nextInt();
      if(max < input_num) {
        max = input_num;
      }
      if(min > input_num) {
        min = input_num;
      }
      sum += input_num;
    }

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

  }
} Main
import java.util.Scanner;

public class Main {

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

  public static void main(String[] args) {
    Scanner stdIn = new Scanner(System.in);
    n = stdIn.nextInt();
    input_num = stdIn.nextInt();
    max = input_num;
    min = input_num;
    sum = input_num;
    for (int i = 1;i < n; i++) {
      input_num = stdIn.nextInt();
      if(max < input_num) {
        max = input_num;
      }
      if(min > input_num) {
        min = input_num;
      }
      sum += input_num;
    }

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

  }
}