Balancing redox equations in acidic and basic medium