/*
 * Aizu Online Judge
 */

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.text.NumberFormat;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author yoshkur
 */
public class Main {

	/**
	 * @param args the command line arguments
	 */
	public static void main(String[] args) {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			DataController controller = new DataController();
			controller.setDataFromLine(br);
			br.close();
			System.out.println(controller.getResult());

		} catch (IOException | NumberFormatException e) {
			System.err.println(e.getLocalizedMessage());
		}
	}
}

class DataService {

	private List<DataEntity> entities = new ArrayList<>();
	private DataEntity entity;

	public DataService() {
	}

	public List<DataEntity> getEntities() {
		return entities;
	}

	public void setEntities(List<DataEntity> entities) {
		this.entities = entities;
	}

	public DataEntity getEntity() {
		if (this.entity == null) {
			this.entity = new DataEntity();
		}
		return entity;
	}

	public void setEntity(DataEntity entity) {
		this.entity = entity;
	}
}

class DataEntity {
	private Integer number;

	public DataEntity() {
	}

	public DataEntity(Integer number) {
		this.number = number;
	}

	public Integer getNumber() {
		return number;
	}

	public void setNumber(Integer number) {
		this.number = number;
	}
}

class DataController {

	private static final String RETCODE = System.getProperty("line.separator");
	public static final String SEPARATOR = " ";

	private final DataService ejb;

	public DataController() {
		this.ejb = new DataService();
	}

	public void setDataFromLine(BufferedReader br) throws IOException {
		Integer count = Integer.valueOf(br.readLine().trim());
		String[] values = br.readLine().trim().split(SEPARATOR);
		for (String str : values) {
			this.ejb.getEntities().add(new DataEntity(Integer.valueOf(str)));
		}
	}

	public void setDataFromLines(BufferedReader br) throws IOException {
		String line;
		while ((line = br.readLine()) != null) {
//			DataEntity entity = new DataEntity();
//			String[] values = line.trim().split(SEPARATOR);
//			entity.setNum0(Integer.valueOf(values[0]));
//			entity.setNum1(Integer.valueOf(values[1]));
//			this.ejb.getEntities().add(entity);
		}
	}

	public String getResult() {
		String result = null;
		Integer min = 1000000;
		Integer max = -1000000;
		Long sum = 0L;
		
		for (DataEntity entity : this.ejb.getEntities()) {
			min = Math.min(min, entity.getNumber());
			max = Math.max(max, entity.getNumber());
			sum += entity.getNumber();
		}
		
		StringBuilder sb = new StringBuilder();
		sb.append(min);
		sb.append(SEPARATOR);
		sb.append(max);
		sb.append(SEPARATOR);
		sb.append(sum);
		result = sb.toString().trim();
		return result;
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.math.BigDecimal; BigDecimal java.math import java.text.NumberFormat; NumberFormat java.text import java.text.DecimalFormat; DecimalFormat java.text import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util public class Main {

	/**
	 * @param args the command line arguments
	 */
	public static void main(String[] args) {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			DataController controller = new DataController();
			controller.setDataFromLine(br);
			br.close();
			System.out.println(controller.getResult());

		} catch (IOException | NumberFormatException e) {
			System.err.println(e.getLocalizedMessage());
		}
	}
} Main /**
	 * @param args the command line arguments
	 */
	public static void main(String[] args) {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			DataController controller = new DataController();
			controller.setDataFromLine(br);
			br.close();
			System.out.println(controller.getResult());

		} catch (IOException | NumberFormatException e) {
			System.err.println(e.getLocalizedMessage());
		}
	} main {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			DataController controller = new DataController();
			controller.setDataFromLine(br);
			br.close();
			System.out.println(controller.getResult());

		} catch (IOException | NumberFormatException e) {
			System.err.println(e.getLocalizedMessage());
		}
	} try {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			DataController controller = new DataController();
			controller.setDataFromLine(br);
			br.close();
			System.out.println(controller.getResult());

		} catch (IOException | NumberFormatException e) {
			System.err.println(e.getLocalizedMessage());
		} catch (IOException | NumberFormatException e) {
			System.err.println(e.getLocalizedMessage());
		} IOException | NumberFormatException e {
			System.err.println(e.getLocalizedMessage());
		} System.err.println(e.getLocalizedMessage()) System.err.println System.err System System.err e.getLocalizedMessage() e.getLocalizedMessage e {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			DataController controller = new DataController();
			controller.setDataFromLine(br);
			br.close();
			System.out.println(controller.getResult());

		} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) DataController controller = new DataController(); controller new DataController() controller.setDataFromLine(br) controller.setDataFromLine controller br br.close() br.close br System.out.println(controller.getResult()) System.out.println System.out System System.out controller.getResult() controller.getResult controller String[] args args class DataService {

	private List<DataEntity> entities = new ArrayList<>();
	private DataEntity entity;

	public DataService() {
	}

	public List<DataEntity> getEntities() {
		return entities;
	}

	public void setEntities(List<DataEntity> entities) {
		this.entities = entities;
	}

	public DataEntity getEntity() {
		if (this.entity == null) {
			this.entity = new DataEntity();
		}
		return entity;
	}

	public void setEntity(DataEntity entity) {
		this.entity = entity;
	}
} DataService private List<DataEntity> entities = new ArrayList<>(); entities new ArrayList<>() private DataEntity entity; entity public DataService() {
	} DataService {
	} public List<DataEntity> getEntities() {
		return entities;
	} getEntities {
		return entities;
	} return entities; entities public void setEntities(List<DataEntity> entities) {
		this.entities = entities;
	} setEntities {
		this.entities = entities;
	} this.entities = entities this.entities this this.entities entities List<DataEntity> entities entities public DataEntity getEntity() {
		if (this.entity == null) {
			this.entity = new DataEntity();
		}
		return entity;
	} getEntity {
		if (this.entity == null) {
			this.entity = new DataEntity();
		}
		return entity;
	} if (this.entity == null) {
			this.entity = new DataEntity();
		} this.entity == null this.entity this this.entity null {
			this.entity = new DataEntity();
		} this.entity = new DataEntity() this.entity this this.entity new DataEntity() return entity; entity public void setEntity(DataEntity entity) {
		this.entity = entity;
	} setEntity {
		this.entity = entity;
	} this.entity = entity this.entity this this.entity entity DataEntity entity entity class DataEntity {
	private Integer number;

	public DataEntity() {
	}

	public DataEntity(Integer number) {
		this.number = number;
	}

	public Integer getNumber() {
		return number;
	}

	public void setNumber(Integer number) {
		this.number = number;
	}
} DataEntity private Integer number; number public DataEntity() {
	} DataEntity {
	} public DataEntity(Integer number) {
		this.number = number;
	} DataEntity {
		this.number = number;
	} this.number = number this.number this this.number number Integer number number public Integer getNumber() {
		return number;
	} getNumber {
		return number;
	} return number; number public void setNumber(Integer number) {
		this.number = number;
	} setNumber {
		this.number = number;
	} this.number = number this.number this this.number number Integer number number class DataController {

	private static final String RETCODE = System.getProperty("line.separator");
	public static final String SEPARATOR = " ";

	private final DataService ejb;

	public DataController() {
		this.ejb = new DataService();
	}

	public void setDataFromLine(BufferedReader br) throws IOException {
		Integer count = Integer.valueOf(br.readLine().trim());
		String[] values = br.readLine().trim().split(SEPARATOR);
		for (String str : values) {
			this.ejb.getEntities().add(new DataEntity(Integer.valueOf(str)));
		}
	}

	public void setDataFromLines(BufferedReader br) throws IOException {
		String line;
		while ((line = br.readLine()) != null) {
//			DataEntity entity = new DataEntity();
//			String[] values = line.trim().split(SEPARATOR);
//			entity.setNum0(Integer.valueOf(values[0]));
//			entity.setNum1(Integer.valueOf(values[1]));
//			this.ejb.getEntities().add(entity);
		}
	}

	public String getResult() {
		String result = null;
		Integer min = 1000000;
		Integer max = -1000000;
		Long sum = 0L;
		
		for (DataEntity entity : this.ejb.getEntities()) {
			min = Math.min(min, entity.getNumber());
			max = Math.max(max, entity.getNumber());
			sum += entity.getNumber();
		}
		
		StringBuilder sb = new StringBuilder();
		sb.append(min);
		sb.append(SEPARATOR);
		sb.append(max);
		sb.append(SEPARATOR);
		sb.append(sum);
		result = sb.toString().trim();
		return result;
	}
} DataController private static final String RETCODE = System.getProperty("line.separator"); RETCODE System.getProperty("line.separator") System.getProperty System "line.separator" public static final String SEPARATOR = " "; SEPARATOR " " private final DataService ejb; ejb public DataController() {
		this.ejb = new DataService();
	} DataController {
		this.ejb = new DataService();
	} this.ejb = new DataService() this.ejb this this.ejb new DataService() public void setDataFromLine(BufferedReader br) throws IOException {
		Integer count = Integer.valueOf(br.readLine().trim());
		String[] values = br.readLine().trim().split(SEPARATOR);
		for (String str : values) {
			this.ejb.getEntities().add(new DataEntity(Integer.valueOf(str)));
		}
	} setDataFromLine {
		Integer count = Integer.valueOf(br.readLine().trim());
		String[] values = br.readLine().trim().split(SEPARATOR);
		for (String str : values) {
			this.ejb.getEntities().add(new DataEntity(Integer.valueOf(str)));
		}
	} Integer count = Integer.valueOf(br.readLine().trim()); count Integer.valueOf(br.readLine().trim()) Integer.valueOf Integer br.readLine().trim() br.readLine().trim br.readLine() br.readLine br String[] values = br.readLine().trim().split(SEPARATOR); values br.readLine().trim().split(SEPARATOR) br.readLine().trim().split br.readLine().trim() br.readLine().trim br.readLine() br.readLine br SEPARATOR for (String str : values) {
			this.ejb.getEntities().add(new DataEntity(Integer.valueOf(str)));
		} String str values {
			this.ejb.getEntities().add(new DataEntity(Integer.valueOf(str)));
		} {
			this.ejb.getEntities().add(new DataEntity(Integer.valueOf(str)));
		} this.ejb.getEntities().add(new DataEntity(Integer.valueOf(str))) this.ejb.getEntities().add this.ejb.getEntities() this.ejb.getEntities this.ejb this this.ejb new DataEntity(Integer.valueOf(str)) BufferedReader br br public void setDataFromLines(BufferedReader br) throws IOException {
		String line;
		while ((line = br.readLine()) != null) {
//			DataEntity entity = new DataEntity();
//			String[] values = line.trim().split(SEPARATOR);
//			entity.setNum0(Integer.valueOf(values[0]));
//			entity.setNum1(Integer.valueOf(values[1]));
//			this.ejb.getEntities().add(entity);
		}
	} setDataFromLines {
		String line;
		while ((line = br.readLine()) != null) {
//			DataEntity entity = new DataEntity();
//			String[] values = line.trim().split(SEPARATOR);
//			entity.setNum0(Integer.valueOf(values[0]));
//			entity.setNum1(Integer.valueOf(values[1]));
//			this.ejb.getEntities().add(entity);
		}
	} String line; line while ((line = br.readLine()) != null) {
//			DataEntity entity = new DataEntity();
//			String[] values = line.trim().split(SEPARATOR);
//			entity.setNum0(Integer.valueOf(values[0]));
//			entity.setNum1(Integer.valueOf(values[1]));
//			this.ejb.getEntities().add(entity);
		} (line = br.readLine()) != null (line = br.readLine()) line br.readLine() br.readLine br null {
//			DataEntity entity = new DataEntity();
//			String[] values = line.trim().split(SEPARATOR);
//			entity.setNum0(Integer.valueOf(values[0]));
//			entity.setNum1(Integer.valueOf(values[1]));
//			this.ejb.getEntities().add(entity);
		} BufferedReader br br public String getResult() {
		String result = null;
		Integer min = 1000000;
		Integer max = -1000000;
		Long sum = 0L;
		
		for (DataEntity entity : this.ejb.getEntities()) {
			min = Math.min(min, entity.getNumber());
			max = Math.max(max, entity.getNumber());
			sum += entity.getNumber();
		}
		
		StringBuilder sb = new StringBuilder();
		sb.append(min);
		sb.append(SEPARATOR);
		sb.append(max);
		sb.append(SEPARATOR);
		sb.append(sum);
		result = sb.toString().trim();
		return result;
	} getResult {
		String result = null;
		Integer min = 1000000;
		Integer max = -1000000;
		Long sum = 0L;
		
		for (DataEntity entity : this.ejb.getEntities()) {
			min = Math.min(min, entity.getNumber());
			max = Math.max(max, entity.getNumber());
			sum += entity.getNumber();
		}
		
		StringBuilder sb = new StringBuilder();
		sb.append(min);
		sb.append(SEPARATOR);
		sb.append(max);
		sb.append(SEPARATOR);
		sb.append(sum);
		result = sb.toString().trim();
		return result;
	} String result = null; result null Integer min = 1000000; min 1000000 Integer max = -1000000; max -1000000 1000000 Long sum = 0L; sum 0L for (DataEntity entity : this.ejb.getEntities()) {
			min = Math.min(min, entity.getNumber());
			max = Math.max(max, entity.getNumber());
			sum += entity.getNumber();
		} DataEntity entity this.ejb.getEntities() this.ejb.getEntities this.ejb this this.ejb {
			min = Math.min(min, entity.getNumber());
			max = Math.max(max, entity.getNumber());
			sum += entity.getNumber();
		} {
			min = Math.min(min, entity.getNumber());
			max = Math.max(max, entity.getNumber());
			sum += entity.getNumber();
		} min = Math.min(min, entity.getNumber()) min Math.min(min, entity.getNumber()) Math.min Math min entity.getNumber() entity.getNumber entity max = Math.max(max, entity.getNumber()) max Math.max(max, entity.getNumber()) Math.max Math max entity.getNumber() entity.getNumber entity sum += entity.getNumber() sum entity.getNumber() entity.getNumber entity StringBuilder sb = new StringBuilder(); sb new StringBuilder() sb.append(min) sb.append sb min sb.append(SEPARATOR) sb.append sb SEPARATOR sb.append(max) sb.append sb max sb.append(SEPARATOR) sb.append sb SEPARATOR sb.append(sum) sb.append sb sum result = sb.toString().trim() result sb.toString().trim() sb.toString().trim sb.toString() sb.toString sb return result; result public class Main {

	/**
	 * @param args the command line arguments
	 */
	public static void main(String[] args) {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			DataController controller = new DataController();
			controller.setDataFromLine(br);
			br.close();
			System.out.println(controller.getResult());

		} catch (IOException | NumberFormatException e) {
			System.err.println(e.getLocalizedMessage());
		}
	}
} public class Main {

	/**
	 * @param args the command line arguments
	 */
	public static void main(String[] args) {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			DataController controller = new DataController();
			controller.setDataFromLine(br);
			br.close();
			System.out.println(controller.getResult());

		} catch (IOException | NumberFormatException e) {
			System.err.println(e.getLocalizedMessage());
		}
	}
} Main
/*
 * Aizu Online Judge
 */

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.text.NumberFormat;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author yoshkur
 */
public class Main {

	/**
	 * @param args the command line arguments
	 */
	public static void main(String[] args) {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			DataController controller = new DataController();
			controller.setDataFromLine(br);
			br.close();
			System.out.println(controller.getResult());

		} catch (IOException | NumberFormatException e) {
			System.err.println(e.getLocalizedMessage());
		}
	}
}

class DataService {

	private List<DataEntity> entities = new ArrayList<>();
	private DataEntity entity;

	public DataService() {
	}

	public List<DataEntity> getEntities() {
		return entities;
	}

	public void setEntities(List<DataEntity> entities) {
		this.entities = entities;
	}

	public DataEntity getEntity() {
		if (this.entity == null) {
			this.entity = new DataEntity();
		}
		return entity;
	}

	public void setEntity(DataEntity entity) {
		this.entity = entity;
	}
}

class DataEntity {
	private Integer number;

	public DataEntity() {
	}

	public DataEntity(Integer number) {
		this.number = number;
	}

	public Integer getNumber() {
		return number;
	}

	public void setNumber(Integer number) {
		this.number = number;
	}
}

class DataController {

	private static final String RETCODE = System.getProperty("line.separator");
	public static final String SEPARATOR = " ";

	private final DataService ejb;

	public DataController() {
		this.ejb = new DataService();
	}

	public void setDataFromLine(BufferedReader br) throws IOException {
		Integer count = Integer.valueOf(br.readLine().trim());
		String[] values = br.readLine().trim().split(SEPARATOR);
		for (String str : values) {
			this.ejb.getEntities().add(new DataEntity(Integer.valueOf(str)));
		}
	}

	public void setDataFromLines(BufferedReader br) throws IOException {
		String line;
		while ((line = br.readLine()) != null) {
//			DataEntity entity = new DataEntity();
//			String[] values = line.trim().split(SEPARATOR);
//			entity.setNum0(Integer.valueOf(values[0]));
//			entity.setNum1(Integer.valueOf(values[1]));
//			this.ejb.getEntities().add(entity);
		}
	}

	public String getResult() {
		String result = null;
		Integer min = 1000000;
		Integer max = -1000000;
		Long sum = 0L;
		
		for (DataEntity entity : this.ejb.getEntities()) {
			min = Math.min(min, entity.getNumber());
			max = Math.max(max, entity.getNumber());
			sum += entity.getNumber();
		}
		
		StringBuilder sb = new StringBuilder();
		sb.append(min);
		sb.append(SEPARATOR);
		sb.append(max);
		sb.append(SEPARATOR);
		sb.append(sum);
		result = sb.toString().trim();
		return result;
	}
}