Mark rows and columns of groups