// Arup Guha
// 7/13/04
// Solution to 2004 BHCSI program that utlizes the Math class and
// illustrates how to order 3 values.

import java.io.*;
import java.util.Random;

public class ThreeNum {

  public static void main(String[] args) throws IOException {

    BufferedReader stdin = new BufferedReader
				(new InputStreamReader(System.in));

    // Generate three random values.
    double num1 = 10+10*Math.random();
    double num2 = 10+10*Math.random();
    double num3 = 10+10*Math.random();

    // Extract max amd min utilizing the math methods twice each.
    double largest = Math.max(Math.max(num1, num2), num3);
    double smallest = Math.min(Math.min(num1, num2), num3);

    // Get the middle by subtracing out the largest and smallest from
    // the sum.
    double middle = num1 + num2 + num3 - largest - smallest;

    // Print out all the relevant information.
    System.out.print("The three numbers generated are ");
    System.out.println(num1+", "+num2+", "+num3+".");
    System.out.println("The largest value is "+largest);
    System.out.println("The smallest value is "+smallest);
    System.out.println("The middle value is "+middle);


  }
}
