import java.util.Scanner;

public class MinMaxFinder
{
   public static void main(String [] args)
   {     
      int min = Integer.MAX_VALUE; 
      int max = Integer.MIN_VALUE;
      
      Scanner console = new Scanner(System.in);

      for(int i = 0; i < 5; i++)
      {
         System.out.println("Enter a number!");
		 int temp = console.nextInt();
         smallest(temp , min);
		 largest(temp , max);
		 
      }
   }
   
   public static int smallest(int a, int b)
   {
      return Math.min(a, b);
   }
   
   public static int largest(int a, int b)
   {
      return Math.max(a, b);
   }
      
   
}
