#C14669. Traffic Light Simulation Controller

    ID: 44343 Type: Default 1000ms 256MiB

Traffic Light Simulation Controller

Traffic Light Simulation Controller

This problem requires you to simulate a basic traffic light controller system. You are given three durations corresponding to the green, yellow, and red lights, as well as a number of iterations (cycles). For each cycle, the traffic light should indicate the state and its corresponding duration in the order: Green, Yellow, and then Red.

In each cycle, you should print a message for every state in the exact format shown in the output. The printed messages must strictly match the expected output. Although a real traffic light would include delays, for this simulation you only need to print the appropriate messages consecutively without implementing actual time delays.

Your program should read input from the standard input (stdin) and write output to the standard output (stdout).

inputFormat

The input consists of a single line with four space-separated integers: green_duration, yellow_duration, red_duration, and iterations. Each integer represents the duration (in seconds) of the corresponding light and the number of complete cycles the traffic light should run.

outputFormat

The output should contain several lines. Each line indicates the state and its duration in the following format:

State: <State>, Duration: <duration>

For every cycle, the states appear in this order: Green, Yellow, and Red. The exact format and order must be followed.

## sample
1 1 1 1
State: Green, Duration: 1

State: Yellow, Duration: 1 State: Red, Duration: 1

</p>