What about this? Is the solution that they don't need to be directly connected, as long as they are connected by the lines? This connects line B to B, and A to A...
Oh, and I threw in the "hi" because you said "Lines can be curved, twisted, w/e, go crazy" and, well, I am.
XD