Ravindra,
As we have been conveying, this is not a proper allocation. I see it as aggregation.
If you could share the requirement (your script doesn't help much, it's rather confusing), you could get much better answer that will help you achieve the desired results.
Regards,
Ashish