always detects same pin as HIGH even when its not connected
You're not showing your schematic but I'm sure that you are simply leaving the Ax pins OPEN when you are not connecting them to your +V line.  In that case they are &quot;floating&quot; and as such they can float HIGH or LOW or just about anywhere.  What's happening is that when you hook up +V to any of them, that has the side-effect of pulling at least A0 HIGH along with it since you have allowed it to float.
Two things to do here:

Don't allow lines to float and expect deterministic behavior.  Tie them to +V or to GROUND when you are not using them.
Pull the Ax lines to +V or GND via a resistor like 10K Ohms.  This will prevent them from floating and will give you predictable results.