import java.io.*;
public class Class1
{
public static void main(String args[ ]){
int i , Max , Min ;
int a[ ] = { 12,67,8,98,23,56,124,55,99,100 };
Max = Min = a[0];
for (i = 1 ; i < a.length; i ++ ) {
if (a<Min ) Min = a;
if (a>Max ) Max = a;
}
System.out.println(Max+" "+Min );
System.out.println();
}
}