Fences in a square