In my bathroom, I had an old wall lamp hanging above the mirror, that was connected to a junction box. I dismounted the old lamp and didn't pay attention to which wires it was connected. Now I need to connect a new lamp and I don't know which wires from the junction box should be used.
The photo of the junction box is below. There is one strand of wires (black, white, ground) coming from the top, and two strands of wires coming from the bottom. All black wires are connected together, and all ground wires are connected together. Now, white wires -- it looks like only two of them were connected, though I'm not sure about that -- maybe one disconnected from other two when I dismounted the old lamp. So the question is: which wires should I use to connect my lamp?
Additional detail: there is a two-way switch on the wall that controls the lamp. The new lamp has standard white, black and ground wires.