A long-stay visa (type D) exempts the holder from visa requirement when travelling within the Schengen area regardless of being multi- or single-entry as long as the visa has not expired. You only enter the Schengen area once and you do not need more entries on the visas when you cross internal borders. The visits to other Schengen countries are limited to a total of no more than 90 days in any 180-day period (although that would be difficult to enforce).
Nonetheless, other conditions other than the visa requirement apply (having a valid travel document like passport, justifying the purpose of visits, having enough financial resources, not being a persona non grata in that country).
Particular attention should be paid in your situation when you are planning to visit country A first at the time of your entry into the Schengen area. If you are not simply passing through country A for transit purposes, the border official is within their rights not only to check the visa and if you are on lists of alerts, but also to examine whether you can justify the purposes and conditions of your visit in country A and whether you have enough financial means for your visit in country A. If you fail to justify the latter conditions, you can be denied entry (whereas if you are simply transiting through A, they cannot deny you entry except if you are on a list of alerts).
1. For intended stays on the territory of the Member States of a duration
of no more than 90 days in any 180-day period, which entails
considering the 180-day period preceding each day of stay, the entry
conditions for third-country nationals shall be the following:
(b) they are in possession of a valid visa, if required pursuant to
Council Regulation (EC) No 539/2001 (25), except where they hold a
valid residence permit or a valid long-stay visa;
5. ... (a) third-country nationals who do not fulfil all the conditions laid down in paragraph 1 but who hold a residence permit or a long-stay visa shall be authorised to enter the territory of the other Member States for transit purposes so that they may reach the territory of the Member State which issued the residence permit or the long-stay visa, unless their names are on the national list of alerts of the Member State whose external borders they are seeking to cross and the alert is accompanied by instructions to refuse entry or transit;
Article 6 of the Schengen Borders Code
You might also want to be prepared to show proof of onward travel to the country that issued your visa.