import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
		String s;
		int inCnt = 0;
		while ((s = stdIn.readLine()) != null) {
			inCnt++;
			if (inCnt % 2 == 1)
				continue;
			String[] se = s.split(" ");
			doMain(inCnt, se);
		}
		System.exit(0);
	}

	private static void doMain(int inCnt, String[] se) {
		int max = Integer.MIN_VALUE, min = Integer.MAX_VALUE;
		long total = 0;
		for (int i = 0; i < se.length; i++) {
			int e = Integer.valueOf(se[i]);
			if (max < e)
				max = e;
			if (min > e)
				min = e;
			total += e;
		}
		System.out.printf("%d %d %d\n", min, max, total);

	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
		String s;
		int inCnt = 0;
		while ((s = stdIn.readLine()) != null) {
			inCnt++;
			if (inCnt % 2 == 1)
				continue;
			String[] se = s.split(" ");
			doMain(inCnt, se);
		}
		System.exit(0);
	}

	private static void doMain(int inCnt, String[] se) {
		int max = Integer.MIN_VALUE, min = Integer.MAX_VALUE;
		long total = 0;
		for (int i = 0; i < se.length; i++) {
			int e = Integer.valueOf(se[i]);
			if (max < e)
				max = e;
			if (min > e)
				min = e;
			total += e;
		}
		System.out.printf("%d %d %d\n", min, max, total);

	}
} Main public static void main(String[] args) throws Exception {
		BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
		String s;
		int inCnt = 0;
		while ((s = stdIn.readLine()) != null) {
			inCnt++;
			if (inCnt % 2 == 1)
				continue;
			String[] se = s.split(" ");
			doMain(inCnt, se);
		}
		System.exit(0);
	} main {
		BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
		String s;
		int inCnt = 0;
		while ((s = stdIn.readLine()) != null) {
			inCnt++;
			if (inCnt % 2 == 1)
				continue;
			String[] se = s.split(" ");
			doMain(inCnt, se);
		}
		System.exit(0);
	} BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in)); stdIn new BufferedReader(new InputStreamReader(System.in)) String s; s int inCnt = 0; inCnt 0 while ((s = stdIn.readLine()) != null) {
			inCnt++;
			if (inCnt % 2 == 1)
				continue;
			String[] se = s.split(" ");
			doMain(inCnt, se);
		} (s = stdIn.readLine()) != null (s = stdIn.readLine()) s stdIn.readLine() stdIn.readLine stdIn null {
			inCnt++;
			if (inCnt % 2 == 1)
				continue;
			String[] se = s.split(" ");
			doMain(inCnt, se);
		} inCnt++ inCnt if (inCnt % 2 == 1)
				continue; inCnt % 2 == 1 inCnt % 2 inCnt 2 1 continue; String[] se = s.split(" "); se s.split(" ") s.split s " " doMain(inCnt, se) doMain inCnt se System.exit(0) System.exit System 0 String[] args args private static void doMain(int inCnt, String[] se) {
		int max = Integer.MIN_VALUE, min = Integer.MAX_VALUE;
		long total = 0;
		for (int i = 0; i < se.length; i++) {
			int e = Integer.valueOf(se[i]);
			if (max < e)
				max = e;
			if (min > e)
				min = e;
			total += e;
		}
		System.out.printf("%d %d %d\n", min, max, total);

	} doMain {
		int max = Integer.MIN_VALUE, min = Integer.MAX_VALUE;
		long total = 0;
		for (int i = 0; i < se.length; i++) {
			int e = Integer.valueOf(se[i]);
			if (max < e)
				max = e;
			if (min > e)
				min = e;
			total += e;
		}
		System.out.printf("%d %d %d\n", min, max, total);

	} int max = Integer.MIN_VALUE max Integer.MIN_VALUE Integer Integer.MIN_VALUE min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE long total = 0; total 0 for (int i = 0; i < se.length; i++) {
			int e = Integer.valueOf(se[i]);
			if (max < e)
				max = e;
			if (min > e)
				min = e;
			total += e;
		} int i = 0; int i = 0; i 0 i < se.length i se.length se se.length i++ i++ i {
			int e = Integer.valueOf(se[i]);
			if (max < e)
				max = e;
			if (min > e)
				min = e;
			total += e;
		} {
			int e = Integer.valueOf(se[i]);
			if (max < e)
				max = e;
			if (min > e)
				min = e;
			total += e;
		} int e = Integer.valueOf(se[i]); e Integer.valueOf(se[i]) Integer.valueOf Integer se[i] se i if (max < e)
				max = e; max < e max e max = e max e if (min > e)
				min = e; min > e min e min = e min e total += e total e System.out.printf("%d %d %d\n", min, max, total) System.out.printf System.out System System.out "%d %d %d\n" min max total int inCnt inCnt String[] se se public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
		String s;
		int inCnt = 0;
		while ((s = stdIn.readLine()) != null) {
			inCnt++;
			if (inCnt % 2 == 1)
				continue;
			String[] se = s.split(" ");
			doMain(inCnt, se);
		}
		System.exit(0);
	}

	private static void doMain(int inCnt, String[] se) {
		int max = Integer.MIN_VALUE, min = Integer.MAX_VALUE;
		long total = 0;
		for (int i = 0; i < se.length; i++) {
			int e = Integer.valueOf(se[i]);
			if (max < e)
				max = e;
			if (min > e)
				min = e;
			total += e;
		}
		System.out.printf("%d %d %d\n", min, max, total);

	}
} public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
		String s;
		int inCnt = 0;
		while ((s = stdIn.readLine()) != null) {
			inCnt++;
			if (inCnt % 2 == 1)
				continue;
			String[] se = s.split(" ");
			doMain(inCnt, se);
		}
		System.exit(0);
	}

	private static void doMain(int inCnt, String[] se) {
		int max = Integer.MIN_VALUE, min = Integer.MAX_VALUE;
		long total = 0;
		for (int i = 0; i < se.length; i++) {
			int e = Integer.valueOf(se[i]);
			if (max < e)
				max = e;
			if (min > e)
				min = e;
			total += e;
		}
		System.out.printf("%d %d %d\n", min, max, total);

	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
		String s;
		int inCnt = 0;
		while ((s = stdIn.readLine()) != null) {
			inCnt++;
			if (inCnt % 2 == 1)
				continue;
			String[] se = s.split(" ");
			doMain(inCnt, se);
		}
		System.exit(0);
	}

	private static void doMain(int inCnt, String[] se) {
		int max = Integer.MIN_VALUE, min = Integer.MAX_VALUE;
		long total = 0;
		for (int i = 0; i < se.length; i++) {
			int e = Integer.valueOf(se[i]);
			if (max < e)
				max = e;
			if (min > e)
				min = e;
			total += e;
		}
		System.out.printf("%d %d %d\n", min, max, total);

	}
}