Hi Shankar,
I did a lot of researched and developed already some add-on solutions in the area of tracing and relationship trees.
I am interested to know which use case is behind your question. What do you try to accomplish with such a complex query?
Volker