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

public class Main {
	public static void main(String[] args) throws Exception {
try {
    long sum =0;
    int min =1000000;
    int max =-1000000;
	
	BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));

	String input1 = buf.readLine();	
	int count = Integer.parseInt(input1);
	
	String input2 = buf.readLine();
	String[] strAry = input2.split(" ");
	
	for (int i = 0; i < count; i++) {
    int x = Integer.parseInt(strAry[i]);
    sum = sum + x;
    if(x < min){ min = x;}
    if(x > max){ max = x;}
	}
	System.out.println(min + " " + max + " " + sum);
} catch (Exception e) {

	System.out.println("????????????");
	
}
		 }
    } import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args) throws Exception {
try {
    long sum =0;
    int min =1000000;
    int max =-1000000;
	
	BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));

	String input1 = buf.readLine();	
	int count = Integer.parseInt(input1);
	
	String input2 = buf.readLine();
	String[] strAry = input2.split(" ");
	
	for (int i = 0; i < count; i++) {
    int x = Integer.parseInt(strAry[i]);
    sum = sum + x;
    if(x < min){ min = x;}
    if(x > max){ max = x;}
	}
	System.out.println(min + " " + max + " " + sum);
} catch (Exception e) {

	System.out.println("????????????");
	
}
		 }
    } Main public static void main(String[] args) throws Exception {
try {
    long sum =0;
    int min =1000000;
    int max =-1000000;
	
	BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));

	String input1 = buf.readLine();	
	int count = Integer.parseInt(input1);
	
	String input2 = buf.readLine();
	String[] strAry = input2.split(" ");
	
	for (int i = 0; i < count; i++) {
    int x = Integer.parseInt(strAry[i]);
    sum = sum + x;
    if(x < min){ min = x;}
    if(x > max){ max = x;}
	}
	System.out.println(min + " " + max + " " + sum);
} catch (Exception e) {

	System.out.println("????????????");
	
}
		 } main {
try {
    long sum =0;
    int min =1000000;
    int max =-1000000;
	
	BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));

	String input1 = buf.readLine();	
	int count = Integer.parseInt(input1);
	
	String input2 = buf.readLine();
	String[] strAry = input2.split(" ");
	
	for (int i = 0; i < count; i++) {
    int x = Integer.parseInt(strAry[i]);
    sum = sum + x;
    if(x < min){ min = x;}
    if(x > max){ max = x;}
	}
	System.out.println(min + " " + max + " " + sum);
} catch (Exception e) {

	System.out.println("????????????");
	
}
		 } try {
    long sum =0;
    int min =1000000;
    int max =-1000000;
	
	BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));

	String input1 = buf.readLine();	
	int count = Integer.parseInt(input1);
	
	String input2 = buf.readLine();
	String[] strAry = input2.split(" ");
	
	for (int i = 0; i < count; i++) {
    int x = Integer.parseInt(strAry[i]);
    sum = sum + x;
    if(x < min){ min = x;}
    if(x > max){ max = x;}
	}
	System.out.println(min + " " + max + " " + sum);
} catch (Exception e) {

	System.out.println("????????????");
	
} catch (Exception e) {

	System.out.println("????????????");
	
} Exception e {

	System.out.println("????????????");
	
} System.out.println("????????????") System.out.println System.out System System.out "????????????" {
    long sum =0;
    int min =1000000;
    int max =-1000000;
	
	BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));

	String input1 = buf.readLine();	
	int count = Integer.parseInt(input1);
	
	String input2 = buf.readLine();
	String[] strAry = input2.split(" ");
	
	for (int i = 0; i < count; i++) {
    int x = Integer.parseInt(strAry[i]);
    sum = sum + x;
    if(x < min){ min = x;}
    if(x > max){ max = x;}
	}
	System.out.println(min + " " + max + " " + sum);
} long sum =0; sum 0 int min =1000000; min 1000000 int max =-1000000; max -1000000 1000000 BufferedReader buf = new BufferedReader(new InputStreamReader(System.in)); buf new BufferedReader(new InputStreamReader(System.in)) String input1 = buf.readLine(); input1 buf.readLine() buf.readLine buf int count = Integer.parseInt(input1); count Integer.parseInt(input1) Integer.parseInt Integer input1 String input2 = buf.readLine(); input2 buf.readLine() buf.readLine buf String[] strAry = input2.split(" "); strAry input2.split(" ") input2.split input2 " " for (int i = 0; i < count; i++) {
    int x = Integer.parseInt(strAry[i]);
    sum = sum + x;
    if(x < min){ min = x;}
    if(x > max){ max = x;}
	} int i = 0; int i = 0; i 0 i < count i count i++ i++ i {
    int x = Integer.parseInt(strAry[i]);
    sum = sum + x;
    if(x < min){ min = x;}
    if(x > max){ max = x;}
	} {
    int x = Integer.parseInt(strAry[i]);
    sum = sum + x;
    if(x < min){ min = x;}
    if(x > max){ max = x;}
	} int x = Integer.parseInt(strAry[i]); x Integer.parseInt(strAry[i]) Integer.parseInt Integer strAry[i] strAry i sum = sum + x sum sum + x sum x if(x < min){ min = x;} x < min x min { min = x;} min = x min x if(x > max){ max = x;} x > max x max { max = x;} max = x max x 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 Exception {
try {
    long sum =0;
    int min =1000000;
    int max =-1000000;
	
	BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));

	String input1 = buf.readLine();	
	int count = Integer.parseInt(input1);
	
	String input2 = buf.readLine();
	String[] strAry = input2.split(" ");
	
	for (int i = 0; i < count; i++) {
    int x = Integer.parseInt(strAry[i]);
    sum = sum + x;
    if(x < min){ min = x;}
    if(x > max){ max = x;}
	}
	System.out.println(min + " " + max + " " + sum);
} catch (Exception e) {

	System.out.println("????????????");
	
}
		 }
    } public class Main {
	public static void main(String[] args) throws Exception {
try {
    long sum =0;
    int min =1000000;
    int max =-1000000;
	
	BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));

	String input1 = buf.readLine();	
	int count = Integer.parseInt(input1);
	
	String input2 = buf.readLine();
	String[] strAry = input2.split(" ");
	
	for (int i = 0; i < count; i++) {
    int x = Integer.parseInt(strAry[i]);
    sum = sum + x;
    if(x < min){ min = x;}
    if(x > max){ max = x;}
	}
	System.out.println(min + " " + max + " " + sum);
} catch (Exception e) {

	System.out.println("????????????");
	
}
		 }
    } Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
try {
    long sum =0;
    int min =1000000;
    int max =-1000000;
	
	BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));

	String input1 = buf.readLine();	
	int count = Integer.parseInt(input1);
	
	String input2 = buf.readLine();
	String[] strAry = input2.split(" ");
	
	for (int i = 0; i < count; i++) {
    int x = Integer.parseInt(strAry[i]);
    sum = sum + x;
    if(x < min){ min = x;}
    if(x > max){ max = x;}
	}
	System.out.println(min + " " + max + " " + sum);
} catch (Exception e) {

	System.out.println("????????????");
	
}
		 }
    }