Are you sure this is the requirement? As this makes it very difficult. However, changing everything from static to non-static is a much better approach and therefore all the static variables become...