def chessboard(m,n,b,z,w,s):
board = plot([])
for i in range(m):
k = n*i
for j in range(m):
l = n*j
if 2*i==j:
c = b
if 2*i<j:
c = w
if 2*i>j:
c = z
square = [[k,l], [k+n,l], [k+n,l+n], [k,l+n]]
board += polygon(square, color=c)
if s:
board.save("board_"+ str(m)+"_"+str(n)+".pdf", aspect_ratio=1, axes=false, dpi=m*n)
else:
board.show(axes=false, aspect_ratio=1, dpi=m*n)