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

public class Main{


	public static void main(String[] args){

//		Scanner scan = new Scanner(System.in);
		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));

		try{
			//int n=scan.nextInt();//int?????????int???????????????????????§?????????????????????
			String t=reader.readLine();
			String s=reader.readLine();//String????????????????????????????????????
			int n=Integer.parseInt(t);
			String[] str =s.split(" ");//
			int array_num[]= new int[n];
			long max, min, sum;
			sum=0;
			max=-1000000;
			min=1000000;

			for(int i=0;i<n;i++){
				array_num[i]=Integer.parseInt(str[i]);
				sum+=array_num[i];

				if(array_num[i]>max)max=array_num[i];
				if(array_num[i]<min)min=array_num[i];
			}

			System.out.println(min+" "+max+" "+sum);



	//		scan.close();
			reader.close();
		}catch(IOException e){
			System.out.println("??¨??????:"+e);

		}

	}

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


	public static void main(String[] args){

//		Scanner scan = new Scanner(System.in);
		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));

		try{
			//int n=scan.nextInt();//int?????????int???????????????????????§?????????????????????
			String t=reader.readLine();
			String s=reader.readLine();//String????????????????????????????????????
			int n=Integer.parseInt(t);
			String[] str =s.split(" ");//
			int array_num[]= new int[n];
			long max, min, sum;
			sum=0;
			max=-1000000;
			min=1000000;

			for(int i=0;i<n;i++){
				array_num[i]=Integer.parseInt(str[i]);
				sum+=array_num[i];

				if(array_num[i]>max)max=array_num[i];
				if(array_num[i]<min)min=array_num[i];
			}

			System.out.println(min+" "+max+" "+sum);



	//		scan.close();
			reader.close();
		}catch(IOException e){
			System.out.println("??¨??????:"+e);

		}

	}

} Main public static void main(String[] args){

//		Scanner scan = new Scanner(System.in);
		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));

		try{
			//int n=scan.nextInt();//int?????????int???????????????????????§?????????????????????
			String t=reader.readLine();
			String s=reader.readLine();//String????????????????????????????????????
			int n=Integer.parseInt(t);
			String[] str =s.split(" ");//
			int array_num[]= new int[n];
			long max, min, sum;
			sum=0;
			max=-1000000;
			min=1000000;

			for(int i=0;i<n;i++){
				array_num[i]=Integer.parseInt(str[i]);
				sum+=array_num[i];

				if(array_num[i]>max)max=array_num[i];
				if(array_num[i]<min)min=array_num[i];
			}

			System.out.println(min+" "+max+" "+sum);



	//		scan.close();
			reader.close();
		}catch(IOException e){
			System.out.println("??¨??????:"+e);

		}

	} main {

//		Scanner scan = new Scanner(System.in);
		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));

		try{
			//int n=scan.nextInt();//int?????????int???????????????????????§?????????????????????
			String t=reader.readLine();
			String s=reader.readLine();//String????????????????????????????????????
			int n=Integer.parseInt(t);
			String[] str =s.split(" ");//
			int array_num[]= new int[n];
			long max, min, sum;
			sum=0;
			max=-1000000;
			min=1000000;

			for(int i=0;i<n;i++){
				array_num[i]=Integer.parseInt(str[i]);
				sum+=array_num[i];

				if(array_num[i]>max)max=array_num[i];
				if(array_num[i]<min)min=array_num[i];
			}

			System.out.println(min+" "+max+" "+sum);



	//		scan.close();
			reader.close();
		}catch(IOException e){
			System.out.println("??¨??????:"+e);

		}

	} BufferedReader reader=new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) try{
			//int n=scan.nextInt();//int?????????int???????????????????????§?????????????????????
			String t=reader.readLine();
			String s=reader.readLine();//String????????????????????????????????????
			int n=Integer.parseInt(t);
			String[] str =s.split(" ");//
			int array_num[]= new int[n];
			long max, min, sum;
			sum=0;
			max=-1000000;
			min=1000000;

			for(int i=0;i<n;i++){
				array_num[i]=Integer.parseInt(str[i]);
				sum+=array_num[i];

				if(array_num[i]>max)max=array_num[i];
				if(array_num[i]<min)min=array_num[i];
			}

			System.out.println(min+" "+max+" "+sum);



	//		scan.close();
			reader.close();
		}catch(IOException e){
			System.out.println("??¨??????:"+e);

		} catch(IOException e){
			System.out.println("??¨??????:"+e);

		} IOException e {
			System.out.println("??¨??????:"+e);

		} System.out.println("??¨??????:"+e) System.out.println System.out System System.out "??¨??????:"+e "??¨??????:" e {
			//int n=scan.nextInt();//int?????????int???????????????????????§?????????????????????
			String t=reader.readLine();
			String s=reader.readLine();//String????????????????????????????????????
			int n=Integer.parseInt(t);
			String[] str =s.split(" ");//
			int array_num[]= new int[n];
			long max, min, sum;
			sum=0;
			max=-1000000;
			min=1000000;

			for(int i=0;i<n;i++){
				array_num[i]=Integer.parseInt(str[i]);
				sum+=array_num[i];

				if(array_num[i]>max)max=array_num[i];
				if(array_num[i]<min)min=array_num[i];
			}

			System.out.println(min+" "+max+" "+sum);



	//		scan.close();
			reader.close();
		} String t=reader.readLine(); t reader.readLine() reader.readLine reader String s=reader.readLine(); s reader.readLine() reader.readLine reader int n=Integer.parseInt(t); n Integer.parseInt(t) Integer.parseInt Integer t String[] str =s.split(" "); str s.split(" ") s.split s " " int array_num[]= new int[n]; array_num new int[n] n long max max min min sum; sum sum=0 sum 0 max=-1000000 max -1000000 1000000 min=1000000 min 1000000 for(int i=0;i<n;i++){
				array_num[i]=Integer.parseInt(str[i]);
				sum+=array_num[i];

				if(array_num[i]>max)max=array_num[i];
				if(array_num[i]<min)min=array_num[i];
			} int i=0; int i=0; i 0 i<n i n i++ i++ i {
				array_num[i]=Integer.parseInt(str[i]);
				sum+=array_num[i];

				if(array_num[i]>max)max=array_num[i];
				if(array_num[i]<min)min=array_num[i];
			} {
				array_num[i]=Integer.parseInt(str[i]);
				sum+=array_num[i];

				if(array_num[i]>max)max=array_num[i];
				if(array_num[i]<min)min=array_num[i];
			} array_num[i]=Integer.parseInt(str[i]) array_num[i] array_num i Integer.parseInt(str[i]) Integer.parseInt Integer str[i] str i sum+=array_num[i] sum array_num[i] array_num i if(array_num[i]>max)max=array_num[i]; array_num[i]>max array_num[i] array_num i max max=array_num[i] max array_num[i] array_num i if(array_num[i]<min)min=array_num[i]; array_num[i]<min array_num[i] array_num i min min=array_num[i] min array_num[i] array_num i System.out.println(min+" "+max+" "+sum) System.out.println System.out System System.out min+" "+max+" "+sum " " max min+" "+max+" "+sum min " " max " " sum reader.close() reader.close reader String[] args args public class Main{


	public static void main(String[] args){

//		Scanner scan = new Scanner(System.in);
		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));

		try{
			//int n=scan.nextInt();//int?????????int???????????????????????§?????????????????????
			String t=reader.readLine();
			String s=reader.readLine();//String????????????????????????????????????
			int n=Integer.parseInt(t);
			String[] str =s.split(" ");//
			int array_num[]= new int[n];
			long max, min, sum;
			sum=0;
			max=-1000000;
			min=1000000;

			for(int i=0;i<n;i++){
				array_num[i]=Integer.parseInt(str[i]);
				sum+=array_num[i];

				if(array_num[i]>max)max=array_num[i];
				if(array_num[i]<min)min=array_num[i];
			}

			System.out.println(min+" "+max+" "+sum);



	//		scan.close();
			reader.close();
		}catch(IOException e){
			System.out.println("??¨??????:"+e);

		}

	}

} public class Main{


	public static void main(String[] args){

//		Scanner scan = new Scanner(System.in);
		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));

		try{
			//int n=scan.nextInt();//int?????????int???????????????????????§?????????????????????
			String t=reader.readLine();
			String s=reader.readLine();//String????????????????????????????????????
			int n=Integer.parseInt(t);
			String[] str =s.split(" ");//
			int array_num[]= new int[n];
			long max, min, sum;
			sum=0;
			max=-1000000;
			min=1000000;

			for(int i=0;i<n;i++){
				array_num[i]=Integer.parseInt(str[i]);
				sum+=array_num[i];

				if(array_num[i]>max)max=array_num[i];
				if(array_num[i]<min)min=array_num[i];
			}

			System.out.println(min+" "+max+" "+sum);



	//		scan.close();
			reader.close();
		}catch(IOException e){
			System.out.println("??¨??????:"+e);

		}

	}

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

public class Main{


	public static void main(String[] args){

//		Scanner scan = new Scanner(System.in);
		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));

		try{
			//int n=scan.nextInt();//int?????????int???????????????????????§?????????????????????
			String t=reader.readLine();
			String s=reader.readLine();//String????????????????????????????????????
			int n=Integer.parseInt(t);
			String[] str =s.split(" ");//
			int array_num[]= new int[n];
			long max, min, sum;
			sum=0;
			max=-1000000;
			min=1000000;

			for(int i=0;i<n;i++){
				array_num[i]=Integer.parseInt(str[i]);
				sum+=array_num[i];

				if(array_num[i]>max)max=array_num[i];
				if(array_num[i]<min)min=array_num[i];
			}

			System.out.println(min+" "+max+" "+sum);



	//		scan.close();
			reader.close();
		}catch(IOException e){
			System.out.println("??¨??????:"+e);

		}

	}

}