Name and state the rule by which the polarity at the ends of a current carrying solenoid is determined.