Whenever you have a problem, please post a complete test scipt that the people who want to help you can run to re-create the problem and test their ideas. In this case, include your procedures (or simplified versions of them), and CREATE TABLE and INSERT statements for any tables they need.
Always say which version of Oracle you're using (for example, 126.96.36.199.0).
See the forum FAQ: https://forums.oracle.com/message/9362002#9362002
Why do you want that output? Why not, for example
r1, r2, t1, t1, g1, r1
Post a couple of different inputs, and the results you want from each. Explain how you get those results in each case.