To celebrate the island's next Founder's Day, colored filters (fuchsia, chartreuse, and aquamarine*) have been installed in every lighthouse. All lighthouses begin operation with their fuchsia filter, and they are all on the same color cycle: FCA, FCA, ... Each lighthouse changes its color filter after every ON blink, whether long or short. In addition, each starts the cycle anew with fuchsia each time its code begins.
Other than the addition of color, lighthouse operation is identical to that in the original challenge, Blinking Lighthouses.
Challenge: Input is identical to the original challenge: the codes for each of n lighthouses in the form of strings of (only) L's and S's.
Output now consists of four lines, one line per color, plus a "totals" line. The top line has the total times that 0...n fuchsia lights were simultaneously on; the second line chartreuse; and the third line aquamarine. Thus the third number in the second line is the total seconds that exactly two chartreuse lights were simultaneously on regardless of what other colors were on during those seconds. The fourth line has the totals for 0...n lights simultaneously on regardless of color (this line is identical to the output of the original challenge).
Unfortunately, Chief of Lighthouse Operations Marie Lumenix has reported a glitch during filter testing. For some reason, if all lighthouses have simultaneously blinked aquamarine at the same time for a total of 5 seconds after the start of operation (the last item in line 3 of output), the electronic color filter system immediately fails and all lighthouses continue their schedules for the rest of the hour blinking white. This glitch will not affect the last, "totals", line of output, but may affect the first three rows, which each total the number of seconds only for the period that filters were working.**
Rules The rules are otherwise the same as in the original challenge. Shortest code in bytes wins.
Just for clarification: the first number in the last row is the total seconds that all lighthouses were off regardless of color. The last row should sum to 3600 sec as in the original challenge, or 1 hr of lighthouse operation. The sums for each row, 1 to 3, should match, whether or not they each total 3600. These three rows stop counting after a glitch.
Test Cases for the broken system
(Input -> Output)
['SLS', 'SLL', 'SSS', 'LSL'] ->
[1178, 360, 90, 40, 5]
[998, 470, 165, 40, 0]
[1178, 165, 270, 55, 5]
[1125, 890, 652, 590, 343]
['SLS', 'LLS', 'SSSL'] ->
[2121, 1158, 288, 33]
[2155, 1219, 226, 0]
[2957, 579, 64, 0]
[1254, 1125, 577, 644]
(The color schedules, in seconds, for the 3 lighthouses in test case #2 case are:
F-CCC-A------- [repeat]
FFF-CCC-A------- [repeat]
F-CCC-A-FFF------- [repeat]
each lighthouse begins the FCA color cycle anew each time its code repeats.)
['SSSLLLSSS', 'LLSSSLLSSLS', 'LSLSLL', 'SSLLL', 'SLLSSSL'] ->
[1334, 1115, 548, 223, 57, 8]
[1560, 1047, 463, 163, 44, 8]
[1591, 950, 525, 184, 30, 5]
[484, 653, 657, 553, 553, 700]
*The colors of Lighthouse Island's flag, chosen by a referendum held at Aloisius' Tavern and Gift Shop.
**Marie feels absolutely terrible about this and promises to get things shipshape by Founder's Day.