If you don't have access to a device like an XRF that can reveal the elemental composition, there is strictly no ideal way to distinguish between these metallic magnets. When I have doubts about the bar magnets I have, or if I come across an unknown magnet, here is what I do: I have very powerful Neodymium N52 magnets that I use for charging. I magnetize the magnet with them, and once I remove the strong magnets, I measure how much charge it retains. For bar magnets, if the general values are around 1200/1400G, I assume it’s likely A8; if it's around 1000G, it's likely A5; around 700/800G is A4; 500/600G is A2; and if it’s slightly below that, I consider it A3. In other words, I make an assumption based on how much magnetic load it can hold.