Traffic Lights#2779

Traffic Lights

1 second
64 megabytes
Easy

Bob is a renowned scientist who lives near his workplace, so he often walks to work. On his route, he encounters a traffic light with three colored bulbs: red, yellow, and green.

The traffic light operates according to the following rules:

  1. The green light is on for seconds.

  2. The green light blinks for seconds. During this phase, the green bulb is on for exactly half the time.

  3. The yellow light is on for seconds.

  4. The red light is on for seconds.

  5. Both the red and yellow lights are on simultaneously for seconds.

After the fifth step, the sequence repeats from the first step. Transitions between modes occur instantly.

Bob wants to know how long each bulb is lit in one day, given that the day lasts seconds. At the start of the day, the green light is on. During the blinking phase, the green bulb is considered to be on for exactly half the time from the beginning to any moment.

Input

The first line contains five integers: , , , , (1 \leq g, gb, y, r, ry \leq 100), with being even.

The second line contains an integer (1 \leq T \leq 10000), the duration of the day in seconds.

Output

Output three integers: the total number of seconds that the red, yellow, and green bulbs are lit, respectively, in one day.

Examples

Example 1

Loading
Loading