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