import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.NoSuchElementException;
import java.util.StringTokenizer;


public class Main {
    public static void main(String[] args) {
    	
    	try{
    		InputStreamReader isr = new InputStreamReader(System.in);
			BufferedReader br = new BufferedReader(isr);
			String buf = br.readLine();
			int n = Integer.parseInt(buf);
			String buf2 = br.readLine();
			StringTokenizer st=new StringTokenizer(buf2," ");
			if(0 <=n && n <=10000){
				int max=-1000000;
				int min=1000000;
				long sum=0;
				int a=0;
				for(int i=1;i <= n; i++){
					if(0 >= st.countTokens())	break;
					a=Integer.parseInt( st.nextToken() );
					if(0 >= a && a>=1000000)	return;
					if(max < a)
						max=a;
					if(min > a)
						min=a;
					sum+=a;
				}
				System.out.println(min+" "+max+" "+sum);
			}
		} catch(IOException e) {
    		System.err.println(e);
		} catch(NoSuchElementException e) {
    		System.err.println(e);
		}
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.NoSuchElementException; NoSuchElementException java.util import java.util.StringTokenizer; StringTokenizer java.util public class Main {
    public static void main(String[] args) {
    	
    	try{
    		InputStreamReader isr = new InputStreamReader(System.in);
			BufferedReader br = new BufferedReader(isr);
			String buf = br.readLine();
			int n = Integer.parseInt(buf);
			String buf2 = br.readLine();
			StringTokenizer st=new StringTokenizer(buf2," ");
			if(0 <=n && n <=10000){
				int max=-1000000;
				int min=1000000;
				long sum=0;
				int a=0;
				for(int i=1;i <= n; i++){
					if(0 >= st.countTokens())	break;
					a=Integer.parseInt( st.nextToken() );
					if(0 >= a && a>=1000000)	return;
					if(max < a)
						max=a;
					if(min > a)
						min=a;
					sum+=a;
				}
				System.out.println(min+" "+max+" "+sum);
			}
		} catch(IOException e) {
    		System.err.println(e);
		} catch(NoSuchElementException e) {
    		System.err.println(e);
		}
    }
} Main public static void main(String[] args) {
    	
    	try{
    		InputStreamReader isr = new InputStreamReader(System.in);
			BufferedReader br = new BufferedReader(isr);
			String buf = br.readLine();
			int n = Integer.parseInt(buf);
			String buf2 = br.readLine();
			StringTokenizer st=new StringTokenizer(buf2," ");
			if(0 <=n && n <=10000){
				int max=-1000000;
				int min=1000000;
				long sum=0;
				int a=0;
				for(int i=1;i <= n; i++){
					if(0 >= st.countTokens())	break;
					a=Integer.parseInt( st.nextToken() );
					if(0 >= a && a>=1000000)	return;
					if(max < a)
						max=a;
					if(min > a)
						min=a;
					sum+=a;
				}
				System.out.println(min+" "+max+" "+sum);
			}
		} catch(IOException e) {
    		System.err.println(e);
		} catch(NoSuchElementException e) {
    		System.err.println(e);
		}
    } main {
    	
    	try{
    		InputStreamReader isr = new InputStreamReader(System.in);
			BufferedReader br = new BufferedReader(isr);
			String buf = br.readLine();
			int n = Integer.parseInt(buf);
			String buf2 = br.readLine();
			StringTokenizer st=new StringTokenizer(buf2," ");
			if(0 <=n && n <=10000){
				int max=-1000000;
				int min=1000000;
				long sum=0;
				int a=0;
				for(int i=1;i <= n; i++){
					if(0 >= st.countTokens())	break;
					a=Integer.parseInt( st.nextToken() );
					if(0 >= a && a>=1000000)	return;
					if(max < a)
						max=a;
					if(min > a)
						min=a;
					sum+=a;
				}
				System.out.println(min+" "+max+" "+sum);
			}
		} catch(IOException e) {
    		System.err.println(e);
		} catch(NoSuchElementException e) {
    		System.err.println(e);
		}
    } try{
    		InputStreamReader isr = new InputStreamReader(System.in);
			BufferedReader br = new BufferedReader(isr);
			String buf = br.readLine();
			int n = Integer.parseInt(buf);
			String buf2 = br.readLine();
			StringTokenizer st=new StringTokenizer(buf2," ");
			if(0 <=n && n <=10000){
				int max=-1000000;
				int min=1000000;
				long sum=0;
				int a=0;
				for(int i=1;i <= n; i++){
					if(0 >= st.countTokens())	break;
					a=Integer.parseInt( st.nextToken() );
					if(0 >= a && a>=1000000)	return;
					if(max < a)
						max=a;
					if(min > a)
						min=a;
					sum+=a;
				}
				System.out.println(min+" "+max+" "+sum);
			}
		} catch(IOException e) {
    		System.err.println(e);
		} catch(NoSuchElementException e) {
    		System.err.println(e);
		} catch(IOException e) {
    		System.err.println(e);
		} IOException e {
    		System.err.println(e);
		} System.err.println(e) System.err.println System.err System System.err e catch(NoSuchElementException e) {
    		System.err.println(e);
		} NoSuchElementException e {
    		System.err.println(e);
		} System.err.println(e) System.err.println System.err System System.err e {
    		InputStreamReader isr = new InputStreamReader(System.in);
			BufferedReader br = new BufferedReader(isr);
			String buf = br.readLine();
			int n = Integer.parseInt(buf);
			String buf2 = br.readLine();
			StringTokenizer st=new StringTokenizer(buf2," ");
			if(0 <=n && n <=10000){
				int max=-1000000;
				int min=1000000;
				long sum=0;
				int a=0;
				for(int i=1;i <= n; i++){
					if(0 >= st.countTokens())	break;
					a=Integer.parseInt( st.nextToken() );
					if(0 >= a && a>=1000000)	return;
					if(max < a)
						max=a;
					if(min > a)
						min=a;
					sum+=a;
				}
				System.out.println(min+" "+max+" "+sum);
			}
		} InputStreamReader isr = new InputStreamReader(System.in); isr new InputStreamReader(System.in) BufferedReader br = new BufferedReader(isr); br new BufferedReader(isr) String buf = br.readLine(); buf br.readLine() br.readLine br int n = Integer.parseInt(buf); n Integer.parseInt(buf) Integer.parseInt Integer buf String buf2 = br.readLine(); buf2 br.readLine() br.readLine br StringTokenizer st=new StringTokenizer(buf2," "); st new StringTokenizer(buf2," ") if(0 <=n && n <=10000){
				int max=-1000000;
				int min=1000000;
				long sum=0;
				int a=0;
				for(int i=1;i <= n; i++){
					if(0 >= st.countTokens())	break;
					a=Integer.parseInt( st.nextToken() );
					if(0 >= a && a>=1000000)	return;
					if(max < a)
						max=a;
					if(min > a)
						min=a;
					sum+=a;
				}
				System.out.println(min+" "+max+" "+sum);
			} 0 <=n && n <=10000 0 <=n 0 n n <=10000 n 10000 {
				int max=-1000000;
				int min=1000000;
				long sum=0;
				int a=0;
				for(int i=1;i <= n; i++){
					if(0 >= st.countTokens())	break;
					a=Integer.parseInt( st.nextToken() );
					if(0 >= a && a>=1000000)	return;
					if(max < a)
						max=a;
					if(min > a)
						min=a;
					sum+=a;
				}
				System.out.println(min+" "+max+" "+sum);
			} int max=-1000000; max -1000000 1000000 int min=1000000; min 1000000 long sum=0; sum 0 int a=0; a 0 for(int i=1;i <= n; i++){
					if(0 >= st.countTokens())	break;
					a=Integer.parseInt( st.nextToken() );
					if(0 >= a && a>=1000000)	return;
					if(max < a)
						max=a;
					if(min > a)
						min=a;
					sum+=a;
				} int i=1; int i=1; i 1 i <= n i n i++ i++ i {
					if(0 >= st.countTokens())	break;
					a=Integer.parseInt( st.nextToken() );
					if(0 >= a && a>=1000000)	return;
					if(max < a)
						max=a;
					if(min > a)
						min=a;
					sum+=a;
				} {
					if(0 >= st.countTokens())	break;
					a=Integer.parseInt( st.nextToken() );
					if(0 >= a && a>=1000000)	return;
					if(max < a)
						max=a;
					if(min > a)
						min=a;
					sum+=a;
				} if(0 >= st.countTokens())	break; 0 >= st.countTokens() 0 st.countTokens() st.countTokens st break; a=Integer.parseInt( st.nextToken() ) a Integer.parseInt( st.nextToken() ) Integer.parseInt Integer st.nextToken() st.nextToken st if(0 >= a && a>=1000000)	return; 0 >= a && a>=1000000 0 >= a 0 a a>=1000000 a 1000000 return; if(max < a)
						max=a; max < a max a max=a max a if(min > a)
						min=a; min > a min a min=a min a sum+=a sum a 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{
    		InputStreamReader isr = new InputStreamReader(System.in);
			BufferedReader br = new BufferedReader(isr);
			String buf = br.readLine();
			int n = Integer.parseInt(buf);
			String buf2 = br.readLine();
			StringTokenizer st=new StringTokenizer(buf2," ");
			if(0 <=n && n <=10000){
				int max=-1000000;
				int min=1000000;
				long sum=0;
				int a=0;
				for(int i=1;i <= n; i++){
					if(0 >= st.countTokens())	break;
					a=Integer.parseInt( st.nextToken() );
					if(0 >= a && a>=1000000)	return;
					if(max < a)
						max=a;
					if(min > a)
						min=a;
					sum+=a;
				}
				System.out.println(min+" "+max+" "+sum);
			}
		} catch(IOException e) {
    		System.err.println(e);
		} catch(NoSuchElementException e) {
    		System.err.println(e);
		}
    }
} public class Main {
    public static void main(String[] args) {
    	
    	try{
    		InputStreamReader isr = new InputStreamReader(System.in);
			BufferedReader br = new BufferedReader(isr);
			String buf = br.readLine();
			int n = Integer.parseInt(buf);
			String buf2 = br.readLine();
			StringTokenizer st=new StringTokenizer(buf2," ");
			if(0 <=n && n <=10000){
				int max=-1000000;
				int min=1000000;
				long sum=0;
				int a=0;
				for(int i=1;i <= n; i++){
					if(0 >= st.countTokens())	break;
					a=Integer.parseInt( st.nextToken() );
					if(0 >= a && a>=1000000)	return;
					if(max < a)
						max=a;
					if(min > a)
						min=a;
					sum+=a;
				}
				System.out.println(min+" "+max+" "+sum);
			}
		} catch(IOException e) {
    		System.err.println(e);
		} catch(NoSuchElementException e) {
    		System.err.println(e);
		}
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.NoSuchElementException;
import java.util.StringTokenizer;


public class Main {
    public static void main(String[] args) {
    	
    	try{
    		InputStreamReader isr = new InputStreamReader(System.in);
			BufferedReader br = new BufferedReader(isr);
			String buf = br.readLine();
			int n = Integer.parseInt(buf);
			String buf2 = br.readLine();
			StringTokenizer st=new StringTokenizer(buf2," ");
			if(0 <=n && n <=10000){
				int max=-1000000;
				int min=1000000;
				long sum=0;
				int a=0;
				for(int i=1;i <= n; i++){
					if(0 >= st.countTokens())	break;
					a=Integer.parseInt( st.nextToken() );
					if(0 >= a && a>=1000000)	return;
					if(max < a)
						max=a;
					if(min > a)
						min=a;
					sum+=a;
				}
				System.out.println(min+" "+max+" "+sum);
			}
		} catch(IOException e) {
    		System.err.println(e);
		} catch(NoSuchElementException e) {
    		System.err.println(e);
		}
    }
}