set F and G in boundary cells