Limit path to first occurance of node with certain label

Assume following graph:

CREATE (a:A {name: 'a'})-[:TO]->(b1:B {name: 'b1'})-[:TO]->(c1:C {name: 'c1'})-[:TO]->(d1:D {name: 'd1'})
CREATE (b1)-[:TO]->(b2:B {name: 'b2'})-[:TO]->(c2:C {name: 'c2'})-[:TO]->(d2:D {name: 'd2'})
CREATE (b2)-[:TO]->(b3:B {name: 'b3'})-[:TO]->(c3:C {name: 'c3'})-[:TO]->(d3:D {name: 'd3'})

Assume, paths are not of fixed length and can get very long.

I would like to retrieve all paths starting in node 'a' but having only the first node labeled 'B'. I also don't want all the subsequent nodes which would have been connected only through one of the nodes labeled with 'B' if it's not the first.

In the example graph, I want this to be the result of my query:

image

I had following idea how to approach this but got stuck on the filtering part of it:

MATCH p = (a:A)-[*]->(t)
WITH labels(t) as ls, a, t
//WHERE path has only first node labeled 'B'
RETURN a, t

Any help would be highly appreciated.