Okay the codes you are mentioning are ANSI code designations for HID (High Intensity Discharge) systems. Both HID lamps and HID ballasts are labeled with them. Sometimes lamps and ballasts have more than one code. If ANY of the codes on the ballast match with ANY codes on a given lamp, they will work together.
All magnetic HID ballasts carry this designation, including mercury vapor, halide, and high pressure sodium lamps. Note however that you cannot usually interchange ballasts and lamps (run a halide lamp with a vapor ballast, etc). There are exceptions to this, the ANSI codes is the true way of knowing.
As easy as that nomenclature is, manufacturers of lamps (and sometimes ballasts) often obfuscate the codes, making them difficult or impossible to determine.
Then, you have to look at it manually. Metal halide ballasts come in 3 flavors. Probe Start, Pulse Start, and HQI.
HQI ballasts will run any metal halide lamp of the design wattage.
Pulse Start ballasts will run any SE (Single Ended "sc-rew in") lamp of the design wattage, and will SOMETIMES run a DE (double ended) lamp of the design wattage.
Probe Start ballasts will run any Probe Start SE lamp of the design wattage, but nothing else.
When I say design wattage, I mean that the ballast is designed to run a certain wattage, and you cannot use a different wattage lamp than what the ballast was designed for.
An M59/H33 ballast is a 400w, Probe Start, Metal Halide ballast. With that, you can run any probe start, 400w, single ended lamp.
Unfortunately, determining whether a lamp is probe or pulse start is difficult without actually seeing the lamp. Generally, lamps manufactured in Germany are pulse start, lamps made in the US are probe. The lamps visually look a bit different internally. You can't rely on online store photos either because stores often photograph one lamp and use that picture to represent every lamp they have. I do not know the specifics of all manufacturers, but I can tell you that 400w SE Hamilton and XM lamps will operate on your ballast. Ushio and Radium lamps will not. Beyond that, you'll have to research it yourself. Good luck.