This structure is normal inheritance nothing custom. You just need to create a root element, then in the second one set parent in menu settings to root. With the third level it is exactly the same with only different that 'parent' is set to second element.