the real puzzling thing here for me is that the component at the junction say A in the following diagram
it seems to be that A will have to be a 3-terminal device rather than just the usual 2-terminal (+/-).... so how do you actually connect them? Or the circuit concept is just a misnomer and has absolutely no relevance to the problem... in that case, it would simply be a graph theory type problem
The battery B and all bulbs An have only 2 terminals each. We must consider one terminal (say -) is grounded and it is not needed to draw in the circuit. So all the lines connecting knots are + terminal.