import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try(Scanner sc = new Scanner(System.in)){

			int cnt = sc.nextInt();
			
			if(cnt <0 || cnt > 10000) {
				System.exit(0);
			}
			
			int[] ary = new int[cnt];
			int input;
			int i=0;
			while(i<cnt) {
				input = sc.nextInt();
				if(input >= -1000000 && input <= 1000000) {
					ary[i] = input;
					i++;
				}
			}
				
			
			long sum =0;
			int min = ary[0];
			int max = ary[0];
			for(int tmp:ary) {
				if(tmp < min) {
					min = tmp;
				}
				if(tmp > max) {
					max = tmp;
				}
				sum += tmp;
			}
			System.out.println(String.format("%d %d %d", min,max,sum));
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		try(Scanner sc = new Scanner(System.in)){

			int cnt = sc.nextInt();
			
			if(cnt <0 || cnt > 10000) {
				System.exit(0);
			}
			
			int[] ary = new int[cnt];
			int input;
			int i=0;
			while(i<cnt) {
				input = sc.nextInt();
				if(input >= -1000000 && input <= 1000000) {
					ary[i] = input;
					i++;
				}
			}
				
			
			long sum =0;
			int min = ary[0];
			int max = ary[0];
			for(int tmp:ary) {
				if(tmp < min) {
					min = tmp;
				}
				if(tmp > max) {
					max = tmp;
				}
				sum += tmp;
			}
			System.out.println(String.format("%d %d %d", min,max,sum));
		}
	}
} Main public static void main(String[] args) {
		try(Scanner sc = new Scanner(System.in)){

			int cnt = sc.nextInt();
			
			if(cnt <0 || cnt > 10000) {
				System.exit(0);
			}
			
			int[] ary = new int[cnt];
			int input;
			int i=0;
			while(i<cnt) {
				input = sc.nextInt();
				if(input >= -1000000 && input <= 1000000) {
					ary[i] = input;
					i++;
				}
			}
				
			
			long sum =0;
			int min = ary[0];
			int max = ary[0];
			for(int tmp:ary) {
				if(tmp < min) {
					min = tmp;
				}
				if(tmp > max) {
					max = tmp;
				}
				sum += tmp;
			}
			System.out.println(String.format("%d %d %d", min,max,sum));
		}
	} main {
		try(Scanner sc = new Scanner(System.in)){

			int cnt = sc.nextInt();
			
			if(cnt <0 || cnt > 10000) {
				System.exit(0);
			}
			
			int[] ary = new int[cnt];
			int input;
			int i=0;
			while(i<cnt) {
				input = sc.nextInt();
				if(input >= -1000000 && input <= 1000000) {
					ary[i] = input;
					i++;
				}
			}
				
			
			long sum =0;
			int min = ary[0];
			int max = ary[0];
			for(int tmp:ary) {
				if(tmp < min) {
					min = tmp;
				}
				if(tmp > max) {
					max = tmp;
				}
				sum += tmp;
			}
			System.out.println(String.format("%d %d %d", min,max,sum));
		}
	} try(Scanner sc = new Scanner(System.in)){

			int cnt = sc.nextInt();
			
			if(cnt <0 || cnt > 10000) {
				System.exit(0);
			}
			
			int[] ary = new int[cnt];
			int input;
			int i=0;
			while(i<cnt) {
				input = sc.nextInt();
				if(input >= -1000000 && input <= 1000000) {
					ary[i] = input;
					i++;
				}
			}
				
			
			long sum =0;
			int min = ary[0];
			int max = ary[0];
			for(int tmp:ary) {
				if(tmp < min) {
					min = tmp;
				}
				if(tmp > max) {
					max = tmp;
				}
				sum += tmp;
			}
			System.out.println(String.format("%d %d %d", min,max,sum));
		} {

			int cnt = sc.nextInt();
			
			if(cnt <0 || cnt > 10000) {
				System.exit(0);
			}
			
			int[] ary = new int[cnt];
			int input;
			int i=0;
			while(i<cnt) {
				input = sc.nextInt();
				if(input >= -1000000 && input <= 1000000) {
					ary[i] = input;
					i++;
				}
			}
				
			
			long sum =0;
			int min = ary[0];
			int max = ary[0];
			for(int tmp:ary) {
				if(tmp < min) {
					min = tmp;
				}
				if(tmp > max) {
					max = tmp;
				}
				sum += tmp;
			}
			System.out.println(String.format("%d %d %d", min,max,sum));
		} Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) int cnt = sc.nextInt(); cnt sc.nextInt() sc.nextInt sc if(cnt <0 || cnt > 10000) {
				System.exit(0);
			} cnt <0 || cnt > 10000 cnt <0 cnt 0 cnt > 10000 cnt 10000 {
				System.exit(0);
			} System.exit(0) System.exit System 0 int[] ary = new int[cnt]; ary new int[cnt] cnt int input; input int i=0; i 0 while(i<cnt) {
				input = sc.nextInt();
				if(input >= -1000000 && input <= 1000000) {
					ary[i] = input;
					i++;
				}
			} i<cnt i cnt {
				input = sc.nextInt();
				if(input >= -1000000 && input <= 1000000) {
					ary[i] = input;
					i++;
				}
			} input = sc.nextInt() input sc.nextInt() sc.nextInt sc if(input >= -1000000 && input <= 1000000) {
					ary[i] = input;
					i++;
				} input >= -1000000 && input <= 1000000 input >= -1000000 input -1000000 1000000 input <= 1000000 input 1000000 {
					ary[i] = input;
					i++;
				} ary[i] = input ary[i] ary i input i++ i long sum =0; sum 0 int min = ary[0]; min ary[0] ary 0 int max = ary[0]; max ary[0] ary 0 for(int tmp:ary) {
				if(tmp < min) {
					min = tmp;
				}
				if(tmp > max) {
					max = tmp;
				}
				sum += tmp;
			} int tmp ary {
				if(tmp < min) {
					min = tmp;
				}
				if(tmp > max) {
					max = tmp;
				}
				sum += tmp;
			} {
				if(tmp < min) {
					min = tmp;
				}
				if(tmp > max) {
					max = tmp;
				}
				sum += tmp;
			} if(tmp < min) {
					min = tmp;
				} tmp < min tmp min {
					min = tmp;
				} min = tmp min tmp if(tmp > max) {
					max = tmp;
				} tmp > max tmp max {
					max = tmp;
				} max = tmp max tmp sum += tmp sum tmp 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) {
		try(Scanner sc = new Scanner(System.in)){

			int cnt = sc.nextInt();
			
			if(cnt <0 || cnt > 10000) {
				System.exit(0);
			}
			
			int[] ary = new int[cnt];
			int input;
			int i=0;
			while(i<cnt) {
				input = sc.nextInt();
				if(input >= -1000000 && input <= 1000000) {
					ary[i] = input;
					i++;
				}
			}
				
			
			long sum =0;
			int min = ary[0];
			int max = ary[0];
			for(int tmp:ary) {
				if(tmp < min) {
					min = tmp;
				}
				if(tmp > max) {
					max = tmp;
				}
				sum += tmp;
			}
			System.out.println(String.format("%d %d %d", min,max,sum));
		}
	}
} public class Main {

	public static void main(String[] args) {
		try(Scanner sc = new Scanner(System.in)){

			int cnt = sc.nextInt();
			
			if(cnt <0 || cnt > 10000) {
				System.exit(0);
			}
			
			int[] ary = new int[cnt];
			int input;
			int i=0;
			while(i<cnt) {
				input = sc.nextInt();
				if(input >= -1000000 && input <= 1000000) {
					ary[i] = input;
					i++;
				}
			}
				
			
			long sum =0;
			int min = ary[0];
			int max = ary[0];
			for(int tmp:ary) {
				if(tmp < min) {
					min = tmp;
				}
				if(tmp > max) {
					max = tmp;
				}
				sum += tmp;
			}
			System.out.println(String.format("%d %d %d", min,max,sum));
		}
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try(Scanner sc = new Scanner(System.in)){

			int cnt = sc.nextInt();
			
			if(cnt <0 || cnt > 10000) {
				System.exit(0);
			}
			
			int[] ary = new int[cnt];
			int input;
			int i=0;
			while(i<cnt) {
				input = sc.nextInt();
				if(input >= -1000000 && input <= 1000000) {
					ary[i] = input;
					i++;
				}
			}
				
			
			long sum =0;
			int min = ary[0];
			int max = ary[0];
			for(int tmp:ary) {
				if(tmp < min) {
					min = tmp;
				}
				if(tmp > max) {
					max = tmp;
				}
				sum += tmp;
			}
			System.out.println(String.format("%d %d %d", min,max,sum));
		}
	}
}