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

public class Main {

	public static void main(String[] args) {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(
					System.in));
			String[] strArray;		
			long sum = 0;
			int num ,max, min;
			
			int n = Integer.parseInt(br.readLine());
			strArray = br.readLine().split("\\s");

			max = Integer.parseInt(strArray[0]);
			min = Integer.parseInt(strArray[0]);
			
			for (int i = 0; i < n; i++) {
				num = Integer.parseInt(strArray[i]);
				if (max < num) {
					max = num;
				} else if (min > num) {
					min = num;
				}
				sum += num;
			}
			br.close();
			System.out.println(min +" "+ max +" "+ sum);
		} catch (Exception e) {
			System.err.println(e);
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(
					System.in));
			String[] strArray;		
			long sum = 0;
			int num ,max, min;
			
			int n = Integer.parseInt(br.readLine());
			strArray = br.readLine().split("\\s");

			max = Integer.parseInt(strArray[0]);
			min = Integer.parseInt(strArray[0]);
			
			for (int i = 0; i < n; i++) {
				num = Integer.parseInt(strArray[i]);
				if (max < num) {
					max = num;
				} else if (min > num) {
					min = num;
				}
				sum += num;
			}
			br.close();
			System.out.println(min +" "+ max +" "+ sum);
		} catch (Exception e) {
			System.err.println(e);
		}
	}
} Main public static void main(String[] args) {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(
					System.in));
			String[] strArray;		
			long sum = 0;
			int num ,max, min;
			
			int n = Integer.parseInt(br.readLine());
			strArray = br.readLine().split("\\s");

			max = Integer.parseInt(strArray[0]);
			min = Integer.parseInt(strArray[0]);
			
			for (int i = 0; i < n; i++) {
				num = Integer.parseInt(strArray[i]);
				if (max < num) {
					max = num;
				} else if (min > num) {
					min = num;
				}
				sum += num;
			}
			br.close();
			System.out.println(min +" "+ max +" "+ sum);
		} catch (Exception e) {
			System.err.println(e);
		}
	} main {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(
					System.in));
			String[] strArray;		
			long sum = 0;
			int num ,max, min;
			
			int n = Integer.parseInt(br.readLine());
			strArray = br.readLine().split("\\s");

			max = Integer.parseInt(strArray[0]);
			min = Integer.parseInt(strArray[0]);
			
			for (int i = 0; i < n; i++) {
				num = Integer.parseInt(strArray[i]);
				if (max < num) {
					max = num;
				} else if (min > num) {
					min = num;
				}
				sum += num;
			}
			br.close();
			System.out.println(min +" "+ max +" "+ sum);
		} catch (Exception e) {
			System.err.println(e);
		}
	} try {
			BufferedReader br = new BufferedReader(new InputStreamReader(
					System.in));
			String[] strArray;		
			long sum = 0;
			int num ,max, min;
			
			int n = Integer.parseInt(br.readLine());
			strArray = br.readLine().split("\\s");

			max = Integer.parseInt(strArray[0]);
			min = Integer.parseInt(strArray[0]);
			
			for (int i = 0; i < n; i++) {
				num = Integer.parseInt(strArray[i]);
				if (max < num) {
					max = num;
				} else if (min > num) {
					min = num;
				}
				sum += num;
			}
			br.close();
			System.out.println(min +" "+ max +" "+ sum);
		} catch (Exception e) {
			System.err.println(e);
		} catch (Exception e) {
			System.err.println(e);
		} Exception e {
			System.err.println(e);
		} System.err.println(e) System.err.println System.err System System.err e {
			BufferedReader br = new BufferedReader(new InputStreamReader(
					System.in));
			String[] strArray;		
			long sum = 0;
			int num ,max, min;
			
			int n = Integer.parseInt(br.readLine());
			strArray = br.readLine().split("\\s");

			max = Integer.parseInt(strArray[0]);
			min = Integer.parseInt(strArray[0]);
			
			for (int i = 0; i < n; i++) {
				num = Integer.parseInt(strArray[i]);
				if (max < num) {
					max = num;
				} else if (min > num) {
					min = num;
				}
				sum += num;
			}
			br.close();
			System.out.println(min +" "+ max +" "+ sum);
		} BufferedReader br = new BufferedReader(new InputStreamReader(
					System.in)); br new BufferedReader(new InputStreamReader(
					System.in)) String[] strArray; strArray long sum = 0; sum 0 int num num max max min; min int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br strArray = br.readLine().split("\\s") strArray br.readLine().split("\\s") br.readLine().split br.readLine() br.readLine br "\\s" max = Integer.parseInt(strArray[0]) max Integer.parseInt(strArray[0]) Integer.parseInt Integer strArray[0] strArray 0 min = Integer.parseInt(strArray[0]) min Integer.parseInt(strArray[0]) Integer.parseInt Integer strArray[0] strArray 0 for (int i = 0; i < n; i++) {
				num = Integer.parseInt(strArray[i]);
				if (max < num) {
					max = num;
				} else if (min > num) {
					min = num;
				}
				sum += num;
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				num = Integer.parseInt(strArray[i]);
				if (max < num) {
					max = num;
				} else if (min > num) {
					min = num;
				}
				sum += num;
			} {
				num = Integer.parseInt(strArray[i]);
				if (max < num) {
					max = num;
				} else if (min > num) {
					min = num;
				}
				sum += num;
			} num = Integer.parseInt(strArray[i]) num Integer.parseInt(strArray[i]) Integer.parseInt Integer strArray[i] strArray i if (max < num) {
					max = num;
				} else if (min > num) {
					min = num;
				} max < num max num {
					max = num;
				} max = num max num if (min > num) {
					min = num;
				} min > num min num {
					min = num;
				} min = num min num sum += num sum num br.close() br.close br System.out.println(min +" "+ max +" "+ sum) System.out.println System.out System System.out min +" "+ max +" "+ sum " " max min +" "+ max +" "+ sum min " " max " " sum String[] args args public class Main {

	public static void main(String[] args) {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(
					System.in));
			String[] strArray;		
			long sum = 0;
			int num ,max, min;
			
			int n = Integer.parseInt(br.readLine());
			strArray = br.readLine().split("\\s");

			max = Integer.parseInt(strArray[0]);
			min = Integer.parseInt(strArray[0]);
			
			for (int i = 0; i < n; i++) {
				num = Integer.parseInt(strArray[i]);
				if (max < num) {
					max = num;
				} else if (min > num) {
					min = num;
				}
				sum += num;
			}
			br.close();
			System.out.println(min +" "+ max +" "+ sum);
		} catch (Exception e) {
			System.err.println(e);
		}
	}
} public class Main {

	public static void main(String[] args) {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(
					System.in));
			String[] strArray;		
			long sum = 0;
			int num ,max, min;
			
			int n = Integer.parseInt(br.readLine());
			strArray = br.readLine().split("\\s");

			max = Integer.parseInt(strArray[0]);
			min = Integer.parseInt(strArray[0]);
			
			for (int i = 0; i < n; i++) {
				num = Integer.parseInt(strArray[i]);
				if (max < num) {
					max = num;
				} else if (min > num) {
					min = num;
				}
				sum += num;
			}
			br.close();
			System.out.println(min +" "+ max +" "+ sum);
		} catch (Exception e) {
			System.err.println(e);
		}
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(
					System.in));
			String[] strArray;		
			long sum = 0;
			int num ,max, min;
			
			int n = Integer.parseInt(br.readLine());
			strArray = br.readLine().split("\\s");

			max = Integer.parseInt(strArray[0]);
			min = Integer.parseInt(strArray[0]);
			
			for (int i = 0; i < n; i++) {
				num = Integer.parseInt(strArray[i]);
				if (max < num) {
					max = num;
				} else if (min > num) {
					min = num;
				}
				sum += num;
			}
			br.close();
			System.out.println(min +" "+ max +" "+ sum);
		} catch (Exception e) {
			System.err.println(e);
		}
	}
}