import java.util.*;
class Main{
	static Scanner s = new Scanner(System.in);
	public static void main(String[] args) {
		s.next();
		long min = Integer.parseInt(s.next()),
		     max = min,
		     sum = min,
		     in;
		while(s.hasNext()) {
			in = Integer.parseInt(s.next());
			min = Math.min(min, in);
			max = Math.max(max, in);
			sum += in;
		}

		System.out.printf("%d %d %d\n",min,max,sum);
	}
} import java.util.*; util.* java class Main{
	static Scanner s = new Scanner(System.in);
	public static void main(String[] args) {
		s.next();
		long min = Integer.parseInt(s.next()),
		     max = min,
		     sum = min,
		     in;
		while(s.hasNext()) {
			in = Integer.parseInt(s.next());
			min = Math.min(min, in);
			max = Math.max(max, in);
			sum += in;
		}

		System.out.printf("%d %d %d\n",min,max,sum);
	}
} Main static Scanner s = new Scanner(System.in); s new Scanner(System.in) public static void main(String[] args) {
		s.next();
		long min = Integer.parseInt(s.next()),
		     max = min,
		     sum = min,
		     in;
		while(s.hasNext()) {
			in = Integer.parseInt(s.next());
			min = Math.min(min, in);
			max = Math.max(max, in);
			sum += in;
		}

		System.out.printf("%d %d %d\n",min,max,sum);
	} main {
		s.next();
		long min = Integer.parseInt(s.next()),
		     max = min,
		     sum = min,
		     in;
		while(s.hasNext()) {
			in = Integer.parseInt(s.next());
			min = Math.min(min, in);
			max = Math.max(max, in);
			sum += in;
		}

		System.out.printf("%d %d %d\n",min,max,sum);
	} s.next() s.next s long min = Integer.parseInt(s.next()) min Integer.parseInt(s.next()) Integer.parseInt Integer s.next() s.next s max = min max min sum = min sum min in; in while(s.hasNext()) {
			in = Integer.parseInt(s.next());
			min = Math.min(min, in);
			max = Math.max(max, in);
			sum += in;
		} s.hasNext() s.hasNext s {
			in = Integer.parseInt(s.next());
			min = Math.min(min, in);
			max = Math.max(max, in);
			sum += in;
		} in = Integer.parseInt(s.next()) in Integer.parseInt(s.next()) Integer.parseInt Integer s.next() s.next s min = Math.min(min, in) min Math.min(min, in) Math.min Math min in max = Math.max(max, in) max Math.max(max, in) Math.max Math max in sum += in sum in System.out.printf("%d %d %d\n",min,max,sum) System.out.printf System.out System System.out "%d %d %d\n" min max sum String[] args args
import java.util.*;
class Main{
	static Scanner s = new Scanner(System.in);
	public static void main(String[] args) {
		s.next();
		long min = Integer.parseInt(s.next()),
		     max = min,
		     sum = min,
		     in;
		while(s.hasNext()) {
			in = Integer.parseInt(s.next());
			min = Math.min(min, in);
			max = Math.max(max, in);
			sum += in;
		}

		System.out.printf("%d %d %d\n",min,max,sum);
	}
}