import java.io.*;

class Main {
	public static void main(String[] args){
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			String buf = br.readLine();
			String[] line = buf.split(" ");
			int a = Integer.parseInt(line[0]);
			long max = a;
			long min = a;
			long total = a;
			for(int i = 1;i < n;i++){
				int b = Integer.parseInt(line[i]);
				if(max<b) max = b;
				if(min>b) min = b;
				total = total + b;
			}
			System.out.print(min+" "+max+" "+total);
			System.out.print("\n");
		} catch(Exception e){
		}
	}
} import java.io.*; io.* java class Main {
	public static void main(String[] args){
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			String buf = br.readLine();
			String[] line = buf.split(" ");
			int a = Integer.parseInt(line[0]);
			long max = a;
			long min = a;
			long total = a;
			for(int i = 1;i < n;i++){
				int b = Integer.parseInt(line[i]);
				if(max<b) max = b;
				if(min>b) min = b;
				total = total + b;
			}
			System.out.print(min+" "+max+" "+total);
			System.out.print("\n");
		} catch(Exception e){
		}
	}
} Main public static void main(String[] args){
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			String buf = br.readLine();
			String[] line = buf.split(" ");
			int a = Integer.parseInt(line[0]);
			long max = a;
			long min = a;
			long total = a;
			for(int i = 1;i < n;i++){
				int b = Integer.parseInt(line[i]);
				if(max<b) max = b;
				if(min>b) min = b;
				total = total + b;
			}
			System.out.print(min+" "+max+" "+total);
			System.out.print("\n");
		} catch(Exception e){
		}
	} main {
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			String buf = br.readLine();
			String[] line = buf.split(" ");
			int a = Integer.parseInt(line[0]);
			long max = a;
			long min = a;
			long total = a;
			for(int i = 1;i < n;i++){
				int b = Integer.parseInt(line[i]);
				if(max<b) max = b;
				if(min>b) min = b;
				total = total + b;
			}
			System.out.print(min+" "+max+" "+total);
			System.out.print("\n");
		} catch(Exception e){
		}
	} try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			String buf = br.readLine();
			String[] line = buf.split(" ");
			int a = Integer.parseInt(line[0]);
			long max = a;
			long min = a;
			long total = a;
			for(int i = 1;i < n;i++){
				int b = Integer.parseInt(line[i]);
				if(max<b) max = b;
				if(min>b) min = b;
				total = total + b;
			}
			System.out.print(min+" "+max+" "+total);
			System.out.print("\n");
		} catch(Exception e){
		} catch(Exception e){
		} Exception e {
		} {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			String buf = br.readLine();
			String[] line = buf.split(" ");
			int a = Integer.parseInt(line[0]);
			long max = a;
			long min = a;
			long total = a;
			for(int i = 1;i < n;i++){
				int b = Integer.parseInt(line[i]);
				if(max<b) max = b;
				if(min>b) min = b;
				total = total + b;
			}
			System.out.print(min+" "+max+" "+total);
			System.out.print("\n");
		} 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 String buf = br.readLine(); buf br.readLine() br.readLine br String[] line = buf.split(" "); line buf.split(" ") buf.split buf " " int a = Integer.parseInt(line[0]); a Integer.parseInt(line[0]) Integer.parseInt Integer line[0] line 0 long max = a; max a long min = a; min a long total = a; total a for(int i = 1;i < n;i++){
				int b = Integer.parseInt(line[i]);
				if(max<b) max = b;
				if(min>b) min = b;
				total = total + b;
			} int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
				int b = Integer.parseInt(line[i]);
				if(max<b) max = b;
				if(min>b) min = b;
				total = total + b;
			} {
				int b = Integer.parseInt(line[i]);
				if(max<b) max = b;
				if(min>b) min = b;
				total = total + b;
			} int b = Integer.parseInt(line[i]); b Integer.parseInt(line[i]) Integer.parseInt Integer line[i] line i if(max<b) max = b; max<b max b max = b max b if(min>b) min = b; min>b min b min = b min b total = total + b total total + b total b System.out.print(min+" "+max+" "+total) System.out.print System.out System System.out min+" "+max+" "+total " " max min+" "+max+" "+total min " " max " " total System.out.print("\n") System.out.print System.out System System.out "\n" String[] args args
import java.io.*;

class Main {
	public static void main(String[] args){
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			String buf = br.readLine();
			String[] line = buf.split(" ");
			int a = Integer.parseInt(line[0]);
			long max = a;
			long min = a;
			long total = a;
			for(int i = 1;i < n;i++){
				int b = Integer.parseInt(line[i]);
				if(max<b) max = b;
				if(min>b) min = b;
				total = total + b;
			}
			System.out.print(min+" "+max+" "+total);
			System.out.print("\n");
		} catch(Exception e){
		}
	}
}