IntermediateRating 1100
Traffic Light
A light cycles green for g seconds, yellow for y, red for r, starting green at time 0. For each query time t print its colour.
Input
g y r, then q, then q times.
Output
q lines.
Sample 1
Input
30 5 25 4 0 31 40 60
Output
GREEN YELLOW RED GREEN
Sample 2
Input
1 1 1 3 0 1 2
Output
GREEN YELLOW RED
Output appears here