import java.util.Scanner;

class Main
{
	public static void main ( String[] args ) {
		Scanner sc = new Scanner ( System.in );

		int n = 0;
		int min = 0;
		int max = 0;
		long sum = 0;

		// n??\???
		n = sc.nextInt ();

		int[] a = new int[ n ];

		// a??\???
		for (int i = 0; i < n; i++ ) {
			a[ i ] = sc.nextInt ();
		}

		// ????¨??????????
		for (int j = 0; j < n; j++ ) {
			sum += a[ j ];
		}

		// ?????§?????\???
		for (int  x = 0; x < n; x++ ) {
			if ( x == 0 ) {
				max = a[ x ];
			} else {
				if ( max < a[ x ] ) {
					max = a[ x ];
				}
			}
		}

		// ????°??????????
		for (int  y = 0; y < n; y++ ) {
			if ( y == 0 ) {
				min = a[ y ];
			} else {
				if ( a[ y ] < min ) {
					min = a[ y ];
				}
			}
		}



		System.out.print ( min + " " + max + " " + sum + "\n" );
	}
} import java.util.Scanner; Scanner java.util class Main
{
	public static void main ( String[] args ) {
		Scanner sc = new Scanner ( System.in );

		int n = 0;
		int min = 0;
		int max = 0;
		long sum = 0;

		// n??\???
		n = sc.nextInt ();

		int[] a = new int[ n ];

		// a??\???
		for (int i = 0; i < n; i++ ) {
			a[ i ] = sc.nextInt ();
		}

		// ????¨??????????
		for (int j = 0; j < n; j++ ) {
			sum += a[ j ];
		}

		// ?????§?????\???
		for (int  x = 0; x < n; x++ ) {
			if ( x == 0 ) {
				max = a[ x ];
			} else {
				if ( max < a[ x ] ) {
					max = a[ x ];
				}
			}
		}

		// ????°??????????
		for (int  y = 0; y < n; y++ ) {
			if ( y == 0 ) {
				min = a[ y ];
			} else {
				if ( a[ y ] < min ) {
					min = a[ y ];
				}
			}
		}



		System.out.print ( min + " " + max + " " + sum + "\n" );
	}
} Main public static void main ( String[] args ) {
		Scanner sc = new Scanner ( System.in );

		int n = 0;
		int min = 0;
		int max = 0;
		long sum = 0;

		// n??\???
		n = sc.nextInt ();

		int[] a = new int[ n ];

		// a??\???
		for (int i = 0; i < n; i++ ) {
			a[ i ] = sc.nextInt ();
		}

		// ????¨??????????
		for (int j = 0; j < n; j++ ) {
			sum += a[ j ];
		}

		// ?????§?????\???
		for (int  x = 0; x < n; x++ ) {
			if ( x == 0 ) {
				max = a[ x ];
			} else {
				if ( max < a[ x ] ) {
					max = a[ x ];
				}
			}
		}

		// ????°??????????
		for (int  y = 0; y < n; y++ ) {
			if ( y == 0 ) {
				min = a[ y ];
			} else {
				if ( a[ y ] < min ) {
					min = a[ y ];
				}
			}
		}



		System.out.print ( min + " " + max + " " + sum + "\n" );
	} main {
		Scanner sc = new Scanner ( System.in );

		int n = 0;
		int min = 0;
		int max = 0;
		long sum = 0;

		// n??\???
		n = sc.nextInt ();

		int[] a = new int[ n ];

		// a??\???
		for (int i = 0; i < n; i++ ) {
			a[ i ] = sc.nextInt ();
		}

		// ????¨??????????
		for (int j = 0; j < n; j++ ) {
			sum += a[ j ];
		}

		// ?????§?????\???
		for (int  x = 0; x < n; x++ ) {
			if ( x == 0 ) {
				max = a[ x ];
			} else {
				if ( max < a[ x ] ) {
					max = a[ x ];
				}
			}
		}

		// ????°??????????
		for (int  y = 0; y < n; y++ ) {
			if ( y == 0 ) {
				min = a[ y ];
			} else {
				if ( a[ y ] < min ) {
					min = a[ y ];
				}
			}
		}



		System.out.print ( min + " " + max + " " + sum + "\n" );
	} Scanner sc = new Scanner ( System.in ); sc new Scanner ( System.in ) int n = 0; n 0 int min = 0; min 0 int max = 0; max 0 long sum = 0; sum 0 n = sc.nextInt () n sc.nextInt () sc.nextInt sc int[] a = new int[ n ]; a new int[ n ] n for (int i = 0; i < n; i++ ) {
			a[ i ] = sc.nextInt ();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			a[ i ] = sc.nextInt ();
		} {
			a[ i ] = sc.nextInt ();
		} a[ i ] = sc.nextInt () a[ i ] a i sc.nextInt () sc.nextInt sc for (int j = 0; j < n; j++ ) {
			sum += a[ j ];
		} int j = 0; int j = 0; j 0 j < n j n j++ j++ j {
			sum += a[ j ];
		} {
			sum += a[ j ];
		} sum += a[ j ] sum a[ j ] a j for (int  x = 0; x < n; x++ ) {
			if ( x == 0 ) {
				max = a[ x ];
			} else {
				if ( max < a[ x ] ) {
					max = a[ x ];
				}
			}
		} int  x = 0; int  x = 0; x 0 x < n x n x++ x++ x {
			if ( x == 0 ) {
				max = a[ x ];
			} else {
				if ( max < a[ x ] ) {
					max = a[ x ];
				}
			}
		} {
			if ( x == 0 ) {
				max = a[ x ];
			} else {
				if ( max < a[ x ] ) {
					max = a[ x ];
				}
			}
		} if ( x == 0 ) {
				max = a[ x ];
			} else {
				if ( max < a[ x ] ) {
					max = a[ x ];
				}
			} x == 0 x 0 {
				max = a[ x ];
			} max = a[ x ] max a[ x ] a x {
				if ( max < a[ x ] ) {
					max = a[ x ];
				}
			} if ( max < a[ x ] ) {
					max = a[ x ];
				} max < a[ x ] max a[ x ] a x {
					max = a[ x ];
				} max = a[ x ] max a[ x ] a x for (int  y = 0; y < n; y++ ) {
			if ( y == 0 ) {
				min = a[ y ];
			} else {
				if ( a[ y ] < min ) {
					min = a[ y ];
				}
			}
		} int  y = 0; int  y = 0; y 0 y < n y n y++ y++ y {
			if ( y == 0 ) {
				min = a[ y ];
			} else {
				if ( a[ y ] < min ) {
					min = a[ y ];
				}
			}
		} {
			if ( y == 0 ) {
				min = a[ y ];
			} else {
				if ( a[ y ] < min ) {
					min = a[ y ];
				}
			}
		} if ( y == 0 ) {
				min = a[ y ];
			} else {
				if ( a[ y ] < min ) {
					min = a[ y ];
				}
			} y == 0 y 0 {
				min = a[ y ];
			} min = a[ y ] min a[ y ] a y {
				if ( a[ y ] < min ) {
					min = a[ y ];
				}
			} if ( a[ y ] < min ) {
					min = a[ y ];
				} a[ y ] < min a[ y ] a y min {
					min = a[ y ];
				} min = a[ y ] min a[ y ] a y System.out.print ( min + " " + max + " " + sum + "\n" ) System.out.print System.out System System.out min + " " + max + " " + sum + "\n" sum " " max min + " " + max + " " + sum + "\n" min " " max " " sum "\n" String[] args args
import java.util.Scanner;

class Main
{
	public static void main ( String[] args ) {
		Scanner sc = new Scanner ( System.in );

		int n = 0;
		int min = 0;
		int max = 0;
		long sum = 0;

		// n??\???
		n = sc.nextInt ();

		int[] a = new int[ n ];

		// a??\???
		for (int i = 0; i < n; i++ ) {
			a[ i ] = sc.nextInt ();
		}

		// ????¨??????????
		for (int j = 0; j < n; j++ ) {
			sum += a[ j ];
		}

		// ?????§?????\???
		for (int  x = 0; x < n; x++ ) {
			if ( x == 0 ) {
				max = a[ x ];
			} else {
				if ( max < a[ x ] ) {
					max = a[ x ];
				}
			}
		}

		// ????°??????????
		for (int  y = 0; y < n; y++ ) {
			if ( y == 0 ) {
				min = a[ y ];
			} else {
				if ( a[ y ] < min ) {
					min = a[ y ];
				}
			}
		}



		System.out.print ( min + " " + max + " " + sum + "\n" );
	}
}