import java.util.Scanner;

class Main
{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int num = sc.nextInt();
    int min, max;
    int[] a = new int[num];

    min = max = a[0] = sc.nextInt();
    long sum = (long)min;

    for(int i=1 ; i < num ; i++){
      a[i] = sc.nextInt();
      if(a[i]<min) min = a[i];
      if(a[i]>max) max = a[i];
      sum += a[i];
    }
      System.out.println(min+" "+max+" "+sum);
  }
} import java.util.Scanner; Scanner java.util class Main
{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int num = sc.nextInt();
    int min, max;
    int[] a = new int[num];

    min = max = a[0] = sc.nextInt();
    long sum = (long)min;

    for(int i=1 ; i < num ; i++){
      a[i] = sc.nextInt();
      if(a[i]<min) min = a[i];
      if(a[i]>max) max = a[i];
      sum += a[i];
    }
      System.out.println(min+" "+max+" "+sum);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int num = sc.nextInt();
    int min, max;
    int[] a = new int[num];

    min = max = a[0] = sc.nextInt();
    long sum = (long)min;

    for(int i=1 ; i < num ; i++){
      a[i] = sc.nextInt();
      if(a[i]<min) min = a[i];
      if(a[i]>max) max = a[i];
      sum += a[i];
    }
      System.out.println(min+" "+max+" "+sum);
  } main {
    Scanner sc = new Scanner(System.in);
    int num = sc.nextInt();
    int min, max;
    int[] a = new int[num];

    min = max = a[0] = sc.nextInt();
    long sum = (long)min;

    for(int i=1 ; i < num ; i++){
      a[i] = sc.nextInt();
      if(a[i]<min) min = a[i];
      if(a[i]>max) max = a[i];
      sum += a[i];
    }
      System.out.println(min+" "+max+" "+sum);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc int min min max; max int[] a = new int[num]; a new int[num] num min = max = a[0] = sc.nextInt() min max = a[0] = sc.nextInt() max a[0] = sc.nextInt() a[0] a 0 sc.nextInt() sc.nextInt sc long sum = (long)min; sum (long)min for(int i=1 ; i < num ; i++){
      a[i] = sc.nextInt();
      if(a[i]<min) min = a[i];
      if(a[i]>max) max = a[i];
      sum += a[i];
    } int i=1 ; int i=1 ; i 1 i < num i num i++ i++ i {
      a[i] = sc.nextInt();
      if(a[i]<min) min = a[i];
      if(a[i]>max) max = a[i];
      sum += a[i];
    } {
      a[i] = sc.nextInt();
      if(a[i]<min) min = a[i];
      if(a[i]>max) max = a[i];
      sum += a[i];
    } a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc if(a[i]<min) min = a[i]; a[i]<min a[i] a i min min = a[i] min a[i] a i if(a[i]>max) max = a[i]; a[i]>max a[i] a i max max = a[i] max a[i] a i sum += a[i] sum a[i] a i 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 sc = new Scanner(System.in);
    int num = sc.nextInt();
    int min, max;
    int[] a = new int[num];

    min = max = a[0] = sc.nextInt();
    long sum = (long)min;

    for(int i=1 ; i < num ; i++){
      a[i] = sc.nextInt();
      if(a[i]<min) min = a[i];
      if(a[i]>max) max = a[i];
      sum += a[i];
    }
      System.out.println(min+" "+max+" "+sum);
  }
}