The 'generation' export is typically used for producing a flattened hierarchy. However, the type of export you are explaining is not typical. With the generation export, you would be able to produce the following:
C, B, A
But that doesn't appear to be what you are looking for.
To meet your requirement, you would need to know the maximum number of levels in your hierarchy. Do you know the max number of levels in the hierarch you are trying to export?