import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int[] a;
		a = new int [10020];
		int n = scan.nextInt();
		int i;
		long sum = 0;
		for(i = 1; i <= n; ++i){
			a[i] = scan.nextInt();
		}
		int tmp = a[1];
		int tmp2 = a[1];
		for(i = 1; i <= n; ++i){
			if(tmp <= a[i]){
				tmp = a[i];
				}
			if(tmp2 >= a[i]){
				tmp2 = a[i];
			}
			sum = sum + a[i];
		}
		System.out.println(tmp2+" "+tmp+" "+sum);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int[] a;
		a = new int [10020];
		int n = scan.nextInt();
		int i;
		long sum = 0;
		for(i = 1; i <= n; ++i){
			a[i] = scan.nextInt();
		}
		int tmp = a[1];
		int tmp2 = a[1];
		for(i = 1; i <= n; ++i){
			if(tmp <= a[i]){
				tmp = a[i];
				}
			if(tmp2 >= a[i]){
				tmp2 = a[i];
			}
			sum = sum + a[i];
		}
		System.out.println(tmp2+" "+tmp+" "+sum);
	}
} Main public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int[] a;
		a = new int [10020];
		int n = scan.nextInt();
		int i;
		long sum = 0;
		for(i = 1; i <= n; ++i){
			a[i] = scan.nextInt();
		}
		int tmp = a[1];
		int tmp2 = a[1];
		for(i = 1; i <= n; ++i){
			if(tmp <= a[i]){
				tmp = a[i];
				}
			if(tmp2 >= a[i]){
				tmp2 = a[i];
			}
			sum = sum + a[i];
		}
		System.out.println(tmp2+" "+tmp+" "+sum);
	} main {
		Scanner scan = new Scanner(System.in);
		int[] a;
		a = new int [10020];
		int n = scan.nextInt();
		int i;
		long sum = 0;
		for(i = 1; i <= n; ++i){
			a[i] = scan.nextInt();
		}
		int tmp = a[1];
		int tmp2 = a[1];
		for(i = 1; i <= n; ++i){
			if(tmp <= a[i]){
				tmp = a[i];
				}
			if(tmp2 >= a[i]){
				tmp2 = a[i];
			}
			sum = sum + a[i];
		}
		System.out.println(tmp2+" "+tmp+" "+sum);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int[] a; a a = new int [10020] a new int [10020] 10020 int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int i; i long sum = 0; sum 0 for(i = 1; i <= n; ++i){
			a[i] = scan.nextInt();
		} i = 1; i = 1 i 1 i <= n i n ++i ++i i {
			a[i] = scan.nextInt();
		} {
			a[i] = scan.nextInt();
		} a[i] = scan.nextInt() a[i] a i scan.nextInt() scan.nextInt scan int tmp = a[1]; tmp a[1] a 1 int tmp2 = a[1]; tmp2 a[1] a 1 for(i = 1; i <= n; ++i){
			if(tmp <= a[i]){
				tmp = a[i];
				}
			if(tmp2 >= a[i]){
				tmp2 = a[i];
			}
			sum = sum + a[i];
		} i = 1; i = 1 i 1 i <= n i n ++i ++i i {
			if(tmp <= a[i]){
				tmp = a[i];
				}
			if(tmp2 >= a[i]){
				tmp2 = a[i];
			}
			sum = sum + a[i];
		} {
			if(tmp <= a[i]){
				tmp = a[i];
				}
			if(tmp2 >= a[i]){
				tmp2 = a[i];
			}
			sum = sum + a[i];
		} if(tmp <= a[i]){
				tmp = a[i];
				} tmp <= a[i] tmp a[i] a i {
				tmp = a[i];
				} tmp = a[i] tmp a[i] a i if(tmp2 >= a[i]){
				tmp2 = a[i];
			} tmp2 >= a[i] tmp2 a[i] a i {
				tmp2 = a[i];
			} tmp2 = a[i] tmp2 a[i] a i sum = sum + a[i] sum sum + a[i] sum a[i] a i System.out.println(tmp2+" "+tmp+" "+sum) System.out.println System.out System System.out tmp2+" "+tmp+" "+sum " " tmp tmp2+" "+tmp+" "+sum tmp2 " " tmp " " sum String[] args args public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int[] a;
		a = new int [10020];
		int n = scan.nextInt();
		int i;
		long sum = 0;
		for(i = 1; i <= n; ++i){
			a[i] = scan.nextInt();
		}
		int tmp = a[1];
		int tmp2 = a[1];
		for(i = 1; i <= n; ++i){
			if(tmp <= a[i]){
				tmp = a[i];
				}
			if(tmp2 >= a[i]){
				tmp2 = a[i];
			}
			sum = sum + a[i];
		}
		System.out.println(tmp2+" "+tmp+" "+sum);
	}
} public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int[] a;
		a = new int [10020];
		int n = scan.nextInt();
		int i;
		long sum = 0;
		for(i = 1; i <= n; ++i){
			a[i] = scan.nextInt();
		}
		int tmp = a[1];
		int tmp2 = a[1];
		for(i = 1; i <= n; ++i){
			if(tmp <= a[i]){
				tmp = a[i];
				}
			if(tmp2 >= a[i]){
				tmp2 = a[i];
			}
			sum = sum + a[i];
		}
		System.out.println(tmp2+" "+tmp+" "+sum);
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int[] a;
		a = new int [10020];
		int n = scan.nextInt();
		int i;
		long sum = 0;
		for(i = 1; i <= n; ++i){
			a[i] = scan.nextInt();
		}
		int tmp = a[1];
		int tmp2 = a[1];
		for(i = 1; i <= n; ++i){
			if(tmp <= a[i]){
				tmp = a[i];
				}
			if(tmp2 >= a[i]){
				tmp2 = a[i];
			}
			sum = sum + a[i];
		}
		System.out.println(tmp2+" "+tmp+" "+sum);
	}
}