import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

  public static void main(String[] args) throws IOException {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    int[] datas = new int[Integer.parseInt(reader.readLine())];
    int min = Integer.MAX_VALUE;
    int max = Integer.MIN_VALUE;
    long sum = 0;
    int c = 0;
    for (String str : reader.readLine().split(" ")) {
      datas[c] = Integer.parseInt(str);
      c++;
    }
    for (int data : datas) {
      if (min > data)
        min = data;
      if (max < data)
        max = data;
      sum += data;
    }
    System.out.println(String.format("%d %d %d", min, max, sum));
  }

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

  public static void main(String[] args) throws IOException {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    int[] datas = new int[Integer.parseInt(reader.readLine())];
    int min = Integer.MAX_VALUE;
    int max = Integer.MIN_VALUE;
    long sum = 0;
    int c = 0;
    for (String str : reader.readLine().split(" ")) {
      datas[c] = Integer.parseInt(str);
      c++;
    }
    for (int data : datas) {
      if (min > data)
        min = data;
      if (max < data)
        max = data;
      sum += data;
    }
    System.out.println(String.format("%d %d %d", min, max, sum));
  }

} Main public static void main(String[] args) throws IOException {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    int[] datas = new int[Integer.parseInt(reader.readLine())];
    int min = Integer.MAX_VALUE;
    int max = Integer.MIN_VALUE;
    long sum = 0;
    int c = 0;
    for (String str : reader.readLine().split(" ")) {
      datas[c] = Integer.parseInt(str);
      c++;
    }
    for (int data : datas) {
      if (min > data)
        min = data;
      if (max < data)
        max = data;
      sum += data;
    }
    System.out.println(String.format("%d %d %d", min, max, sum));
  } main {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    int[] datas = new int[Integer.parseInt(reader.readLine())];
    int min = Integer.MAX_VALUE;
    int max = Integer.MIN_VALUE;
    long sum = 0;
    int c = 0;
    for (String str : reader.readLine().split(" ")) {
      datas[c] = Integer.parseInt(str);
      c++;
    }
    for (int data : datas) {
      if (min > data)
        min = data;
      if (max < data)
        max = data;
      sum += data;
    }
    System.out.println(String.format("%d %d %d", min, max, sum));
  } BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) int[] datas = new int[Integer.parseInt(reader.readLine())]; datas new int[Integer.parseInt(reader.readLine())] Integer.parseInt(reader.readLine()) Integer.parseInt Integer reader.readLine() reader.readLine reader int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE int max = Integer.MIN_VALUE; max Integer.MIN_VALUE Integer Integer.MIN_VALUE long sum = 0; sum 0 int c = 0; c 0 for (String str : reader.readLine().split(" ")) {
      datas[c] = Integer.parseInt(str);
      c++;
    } String str reader.readLine().split(" ") reader.readLine().split reader.readLine() reader.readLine reader " " {
      datas[c] = Integer.parseInt(str);
      c++;
    } {
      datas[c] = Integer.parseInt(str);
      c++;
    } datas[c] = Integer.parseInt(str) datas[c] datas c Integer.parseInt(str) Integer.parseInt Integer str c++ c for (int data : datas) {
      if (min > data)
        min = data;
      if (max < data)
        max = data;
      sum += data;
    } int data datas {
      if (min > data)
        min = data;
      if (max < data)
        max = data;
      sum += data;
    } {
      if (min > data)
        min = data;
      if (max < data)
        max = data;
      sum += data;
    } if (min > data)
        min = data; min > data min data min = data min data if (max < data)
        max = data; max < data max data max = data max data sum += data sum data System.out.println(String.format("%d %d %d", min, max, sum)) System.out.println System.out System System.out String.format("%d %d %d", min, max, sum) String.format String "%d %d %d" min max sum String[] args args public class Main {

  public static void main(String[] args) throws IOException {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    int[] datas = new int[Integer.parseInt(reader.readLine())];
    int min = Integer.MAX_VALUE;
    int max = Integer.MIN_VALUE;
    long sum = 0;
    int c = 0;
    for (String str : reader.readLine().split(" ")) {
      datas[c] = Integer.parseInt(str);
      c++;
    }
    for (int data : datas) {
      if (min > data)
        min = data;
      if (max < data)
        max = data;
      sum += data;
    }
    System.out.println(String.format("%d %d %d", min, max, sum));
  }

} public class Main {

  public static void main(String[] args) throws IOException {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    int[] datas = new int[Integer.parseInt(reader.readLine())];
    int min = Integer.MAX_VALUE;
    int max = Integer.MIN_VALUE;
    long sum = 0;
    int c = 0;
    for (String str : reader.readLine().split(" ")) {
      datas[c] = Integer.parseInt(str);
      c++;
    }
    for (int data : datas) {
      if (min > data)
        min = data;
      if (max < data)
        max = data;
      sum += data;
    }
    System.out.println(String.format("%d %d %d", min, max, sum));
  }

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

  public static void main(String[] args) throws IOException {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    int[] datas = new int[Integer.parseInt(reader.readLine())];
    int min = Integer.MAX_VALUE;
    int max = Integer.MIN_VALUE;
    long sum = 0;
    int c = 0;
    for (String str : reader.readLine().split(" ")) {
      datas[c] = Integer.parseInt(str);
      c++;
    }
    for (int data : datas) {
      if (min > data)
        min = data;
      if (max < data)
        max = data;
      sum += data;
    }
    System.out.println(String.format("%d %d %d", min, max, sum));
  }

}