Thanks for replying @Sagar Pagar, sorry, but list collector is not an option for this particular problem.
Is there any other way without using any kind of reference table.