/****************************************************************

            Example Solution for "Snack Time for Fido"

	---------------------------------------------------------
		Author   :  Xiao Ma
					(maxiao812@msn.com)
	  Beginning  :  2004-10-13 
	 Last Update :  2004-10-13
	  File Name  :  Snack_Solution.cpp
	     Log	 :  2004-10-13 Finish, send to other coaches.
	---------------------------------------------------------

   This program is the example solution for the problem in 
SER'97 -- 'Snack Time for Fido'.

   Assume d1 and d2 are the distance from Joe and Fido to the lounge
respectively, v1 and v2 are speed at which Joe and Fido runs respectively.

   We can devide the situation into 3 classes.
   (1) d1<d2

        (Joe) ->          <- (Fido)              Lounge
          |                     |                   |
		  |                     |--------- d1 ------|
		  |----------------- d2 --------------------|

        Definitely, Fido will have a snack.

   (2) d1=d2

                        (Fido)              Lounge
						(Joe)                  |
                          |-------d1,d2--------|
         
	    I'm not sure about this situation.    


   (3) d1>d2

        (Fido) ->             (Joe) ->           Lounge
          |                     |                   |
		  |                     |--------- d2 ------|
		  |----------------- d1 --------------------|
   
       Only now,  Fido had to catch up Joe.
       We can calculate the time they have to spend in running over
   the distance.
					   t1 = d1 / v1;
					   t2 = d2 / v2;
       Obviously, if t1<t2, Joe will be ate, otherwise, he
  can make it.

****************************************************************/

#include <iostream>
#include <fstream>

using namespace std;

ifstream inf ("snack.dat");
ofstream outf ("snack.out");

int main ()
{
	double d1,d2;		// the distance from Joe/Fido to the lounge
	double v1,v2,		// the speed of Joe/Fido
	double t1,t2;		// the time which Joe/Fido had to take to get to the gate

	while (1) {

		inf >> d1 >> d2 >> v1 >> v2;
		if (d1==0 && d2==0 && v1==0 && v2==0)
			break;


		if ( d1<d2 ) {
			t1 = (double)d1/v1;		// t1 is the time Joe have to spend
			t2 = (double)d2/v2;		// t2 is the time Fido have to spend

			if ( t2<t1 )
				outf << "Fido is no longer hungry." << endl;
			else
				outf << "Joe makes it." << endl;
		}
		else
			outf << "Fido is no longer hungry." << endl;
	}
	return 0;
}
