Under construction

Still being built. Things may change

Gahui and the 4-Hour Wall 2

Time limit1sMemory limit512 MB

Summary
Given the rail time S and the flight legs Ma, Fab, and Mb, decide whether most passengers at station a take high speed rail or a flight.
Level

Easy2 of 10

Topics
Implementation
Solved
No attempts yet

Problem

The 4-hour wall is the tendency where, when high speed rail and flights compete, high speed rail is superior on routes it covers in 44 hours or less, and otherwise flights are superior. When a passenger pp travels on route ss, the passenger takes high speed rail if at least one of the two conditions below holds. Otherwise, the passenger takes a flight.

  • When traveling on route ss, the flight takes the same time or longer than high speed rail.
  • Passenger pp likes trains. Also, high speed rail covers route ss in 44 hours or less.

Traveling from station aa to station bb by high speed rail takes S_abS\_{ab} minutes. Traveling from station aa to station bb by flight takes the sum of the following:

  • M_aM\_{a} minutes from station aa to airport aa
  • F_abF\_{ab} minutes from airport aa to airport bb
  • M_bM\_{b} minutes from airport bb to station bb

People who use station aa include more people who like trains. For people who use station aa and travel from station aa to station bb, report which transportation mode is used more.

Input

The first line contains S_abS\_{ab} as described in the problem.

The second line contains M_aM\_{a}, F_abF\_{ab}, and M_bM\_{b} as described in the problem, separated by spaces.

Output

If people who use station aa use high speed rail more when traveling from station aa to station bb, print high speed rail. Otherwise, print flight.

Constraints

  • Every travel time is at least 11 minute and at most 738738 minutes.
  • High speed rail and flights depart on time and arrive on time.

Examples2

  1. Example 1

    Input
    303
    1 1 1
    
    Expected output
    flight
    
  2. Example 2

    Input
    303
    101 101 103
    
    Expected output
    high speed rail