import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
	public static void main(String[] args) throws IOException{
		int n,min=0,max=0;
		long sum=0;
		String[] list;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		n = Integer.parseInt(br.readLine());
		list = br.readLine().split(" ");

		min = Integer.parseInt(list[0]);
		max = Integer.parseInt(list[0]);

		for(int i = 0; i < n; i++){
			int num = Integer.parseInt(list[i]);
			sum += num;
			if(min > num)min = num;
			if(max < num)max = num;
		}
		System.out.println(min + " " + max + " " + sum);

        br.close();
	}
} 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{
		int n,min=0,max=0;
		long sum=0;
		String[] list;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		n = Integer.parseInt(br.readLine());
		list = br.readLine().split(" ");

		min = Integer.parseInt(list[0]);
		max = Integer.parseInt(list[0]);

		for(int i = 0; i < n; i++){
			int num = Integer.parseInt(list[i]);
			sum += num;
			if(min > num)min = num;
			if(max < num)max = num;
		}
		System.out.println(min + " " + max + " " + sum);

        br.close();
	}
} Main public static void main(String[] args) throws IOException{
		int n,min=0,max=0;
		long sum=0;
		String[] list;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		n = Integer.parseInt(br.readLine());
		list = br.readLine().split(" ");

		min = Integer.parseInt(list[0]);
		max = Integer.parseInt(list[0]);

		for(int i = 0; i < n; i++){
			int num = Integer.parseInt(list[i]);
			sum += num;
			if(min > num)min = num;
			if(max < num)max = num;
		}
		System.out.println(min + " " + max + " " + sum);

        br.close();
	} main {
		int n,min=0,max=0;
		long sum=0;
		String[] list;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		n = Integer.parseInt(br.readLine());
		list = br.readLine().split(" ");

		min = Integer.parseInt(list[0]);
		max = Integer.parseInt(list[0]);

		for(int i = 0; i < n; i++){
			int num = Integer.parseInt(list[i]);
			sum += num;
			if(min > num)min = num;
			if(max < num)max = num;
		}
		System.out.println(min + " " + max + " " + sum);

        br.close();
	} int n n min=0 min 0 max=0; max 0 long sum=0; sum 0 String[] list; list BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) n = Integer.parseInt(br.readLine()) n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br list = br.readLine().split(" ") list br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " min = Integer.parseInt(list[0]) min Integer.parseInt(list[0]) Integer.parseInt Integer list[0] list 0 max = Integer.parseInt(list[0]) max Integer.parseInt(list[0]) Integer.parseInt Integer list[0] list 0 for(int i = 0; i < n; i++){
			int num = Integer.parseInt(list[i]);
			sum += num;
			if(min > num)min = num;
			if(max < num)max = num;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int num = Integer.parseInt(list[i]);
			sum += num;
			if(min > num)min = num;
			if(max < num)max = num;
		} {
			int num = Integer.parseInt(list[i]);
			sum += num;
			if(min > num)min = num;
			if(max < num)max = num;
		} int num = Integer.parseInt(list[i]); num Integer.parseInt(list[i]) Integer.parseInt Integer list[i] list i sum += num sum num if(min > num)min = num; min > num min num min = num min num if(max < num)max = num; max < num max num max = num max num System.out.println(min + " " + max + " " + sum) System.out.println System.out System System.out min + " " + max + " " + sum " " max min + " " + max + " " + sum min " " max " " sum br.close() br.close br String[] args args public class Main {
	public static void main(String[] args) throws IOException{
		int n,min=0,max=0;
		long sum=0;
		String[] list;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		n = Integer.parseInt(br.readLine());
		list = br.readLine().split(" ");

		min = Integer.parseInt(list[0]);
		max = Integer.parseInt(list[0]);

		for(int i = 0; i < n; i++){
			int num = Integer.parseInt(list[i]);
			sum += num;
			if(min > num)min = num;
			if(max < num)max = num;
		}
		System.out.println(min + " " + max + " " + sum);

        br.close();
	}
} public class Main {
	public static void main(String[] args) throws IOException{
		int n,min=0,max=0;
		long sum=0;
		String[] list;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		n = Integer.parseInt(br.readLine());
		list = br.readLine().split(" ");

		min = Integer.parseInt(list[0]);
		max = Integer.parseInt(list[0]);

		for(int i = 0; i < n; i++){
			int num = Integer.parseInt(list[i]);
			sum += num;
			if(min > num)min = num;
			if(max < num)max = num;
		}
		System.out.println(min + " " + max + " " + sum);

        br.close();
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
	public static void main(String[] args) throws IOException{
		int n,min=0,max=0;
		long sum=0;
		String[] list;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		n = Integer.parseInt(br.readLine());
		list = br.readLine().split(" ");

		min = Integer.parseInt(list[0]);
		max = Integer.parseInt(list[0]);

		for(int i = 0; i < n; i++){
			int num = Integer.parseInt(list[i]);
			sum += num;
			if(min > num)min = num;
			if(max < num)max = num;
		}
		System.out.println(min + " " + max + " " + sum);

        br.close();
	}
}