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

public class Main {
	public static void main(String[] args) {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    
		String x = "";
		try {
			x = in.readLine();
			int num = Integer.parseInt(x);

			x = in.readLine();
			
			String[] values = x.split(" ");

			int value = Integer.parseInt(values[0]);
			int min = value;
			int max = value;
			long sum = value;
			
			for (int i = 1; i < num; i++) {
				value = Integer.parseInt(values[i]);
				
				if (min > value) min = value;
				if (max < value) max = value;
				sum = sum + value;
			}
			
			System.out.println(min + " " + max + " " + sum);
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
} 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) {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    
		String x = "";
		try {
			x = in.readLine();
			int num = Integer.parseInt(x);

			x = in.readLine();
			
			String[] values = x.split(" ");

			int value = Integer.parseInt(values[0]);
			int min = value;
			int max = value;
			long sum = value;
			
			for (int i = 1; i < num; i++) {
				value = Integer.parseInt(values[i]);
				
				if (min > value) min = value;
				if (max < value) max = value;
				sum = sum + value;
			}
			
			System.out.println(min + " " + max + " " + sum);
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
} Main public static void main(String[] args) {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    
		String x = "";
		try {
			x = in.readLine();
			int num = Integer.parseInt(x);

			x = in.readLine();
			
			String[] values = x.split(" ");

			int value = Integer.parseInt(values[0]);
			int min = value;
			int max = value;
			long sum = value;
			
			for (int i = 1; i < num; i++) {
				value = Integer.parseInt(values[i]);
				
				if (min > value) min = value;
				if (max < value) max = value;
				sum = sum + value;
			}
			
			System.out.println(min + " " + max + " " + sum);
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	} main {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    
		String x = "";
		try {
			x = in.readLine();
			int num = Integer.parseInt(x);

			x = in.readLine();
			
			String[] values = x.split(" ");

			int value = Integer.parseInt(values[0]);
			int min = value;
			int max = value;
			long sum = value;
			
			for (int i = 1; i < num; i++) {
				value = Integer.parseInt(values[i]);
				
				if (min > value) min = value;
				if (max < value) max = value;
				sum = sum + value;
			}
			
			System.out.println(min + " " + max + " " + sum);
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	} BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) String x = ""; x "" try {
			x = in.readLine();
			int num = Integer.parseInt(x);

			x = in.readLine();
			
			String[] values = x.split(" ");

			int value = Integer.parseInt(values[0]);
			int min = value;
			int max = value;
			long sum = value;
			
			for (int i = 1; i < num; i++) {
				value = Integer.parseInt(values[i]);
				
				if (min > value) min = value;
				if (max < value) max = value;
				sum = sum + value;
			}
			
			System.out.println(min + " " + max + " " + sum);
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} NumberFormatException e {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} IOException e {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			x = in.readLine();
			int num = Integer.parseInt(x);

			x = in.readLine();
			
			String[] values = x.split(" ");

			int value = Integer.parseInt(values[0]);
			int min = value;
			int max = value;
			long sum = value;
			
			for (int i = 1; i < num; i++) {
				value = Integer.parseInt(values[i]);
				
				if (min > value) min = value;
				if (max < value) max = value;
				sum = sum + value;
			}
			
			System.out.println(min + " " + max + " " + sum);
		} x = in.readLine() x in.readLine() in.readLine in int num = Integer.parseInt(x); num Integer.parseInt(x) Integer.parseInt Integer x x = in.readLine() x in.readLine() in.readLine in String[] values = x.split(" "); values x.split(" ") x.split x " " int value = Integer.parseInt(values[0]); value Integer.parseInt(values[0]) Integer.parseInt Integer values[0] values 0 int min = value; min value int max = value; max value long sum = value; sum value for (int i = 1; i < num; i++) {
				value = Integer.parseInt(values[i]);
				
				if (min > value) min = value;
				if (max < value) max = value;
				sum = sum + value;
			} int i = 1; int i = 1; i 1 i < num i num i++ i++ i {
				value = Integer.parseInt(values[i]);
				
				if (min > value) min = value;
				if (max < value) max = value;
				sum = sum + value;
			} {
				value = Integer.parseInt(values[i]);
				
				if (min > value) min = value;
				if (max < value) max = value;
				sum = sum + value;
			} value = Integer.parseInt(values[i]) value Integer.parseInt(values[i]) Integer.parseInt Integer values[i] values i if (min > value) min = value; min > value min value min = value min value if (max < value) max = value; max < value max value max = value max value sum = sum + value sum sum + value sum value 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) {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    
		String x = "";
		try {
			x = in.readLine();
			int num = Integer.parseInt(x);

			x = in.readLine();
			
			String[] values = x.split(" ");

			int value = Integer.parseInt(values[0]);
			int min = value;
			int max = value;
			long sum = value;
			
			for (int i = 1; i < num; i++) {
				value = Integer.parseInt(values[i]);
				
				if (min > value) min = value;
				if (max < value) max = value;
				sum = sum + value;
			}
			
			System.out.println(min + " " + max + " " + sum);
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
} public class Main {
	public static void main(String[] args) {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    
		String x = "";
		try {
			x = in.readLine();
			int num = Integer.parseInt(x);

			x = in.readLine();
			
			String[] values = x.split(" ");

			int value = Integer.parseInt(values[0]);
			int min = value;
			int max = value;
			long sum = value;
			
			for (int i = 1; i < num; i++) {
				value = Integer.parseInt(values[i]);
				
				if (min > value) min = value;
				if (max < value) max = value;
				sum = sum + value;
			}
			
			System.out.println(min + " " + max + " " + sum);
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    
		String x = "";
		try {
			x = in.readLine();
			int num = Integer.parseInt(x);

			x = in.readLine();
			
			String[] values = x.split(" ");

			int value = Integer.parseInt(values[0]);
			int min = value;
			int max = value;
			long sum = value;
			
			for (int i = 1; i < num; i++) {
				value = Integer.parseInt(values[i]);
				
				if (min > value) min = value;
				if (max < value) max = value;
				sum = sum + value;
			}
			
			System.out.println(min + " " + max + " " + sum);
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}