Varun Sareen wrote:
How to solve this problem?
Well, for a start you could tell us what the grid is? I can't deduce it from your description and, without this info, I doubt that anybody else could. This is pretty vital information if you want people to help.