// Arup Guha
// Created on 2/6/06 by using the main from Time.java
// Illustrates that Time objects can be used in other classes.
	
import java.util.*;

public class UseTime {
	

	public static void main(String args[]) {

		Scanner stdin = new Scanner(System.in);

		// Get the amount of time needed to bake.
		System.out.println("Enter how long it took to bake your dinner");
		System.out.println("First enter hours followed by minutes on the next line.");
		int hours_bake = stdin.nextInt();
		int minutes_bake = stdin.nextInt();

		// Get the amount of time needed to microwave.
		System.out.println("Enter how long it took to nuke your dinner");
		System.out.println("First enter hours followed by hours on the next line.");
		int hours_nuke = stdin.nextInt();
		int minutes_nuke = stdin.nextInt();

		// Create two corresponding time objects.
		Time bake = new Time(hours_bake, minutes_bake);
		Time nuke = new Time(hours_nuke, minutes_nuke);

		// Print out a message based on the difference in the cooking times!
		if (bake.equals(nuke)) {
	    	System.out.println("Baking and Microwaving this food take the same amount of time.");
		}
		else if (bake.greaterthan(nuke)) {
	    	Time temp = bake.difference(nuke);
	    	System.out.println("Microwaving will save you "+temp+" amount of time.");
		}
		else {
	    	Time temp = nuke.difference(bake);
	    	System.out.println("You are cooking some really weird stuff.");
	    	System.out.println("Baking will save you "+temp+" amount of time.");
		}
    }
   
}