Very Simple Grid Marks Write a program or function that takes in three positive integers, W, H, and N. Print or return a W&times;H grid of .'s where every Nth . in normal English reading order is replaced with an X.

For example, given W = 7, H = 3, N = 3, the grid is 7 characters wide and 3 high, and every third character reading from the top left is an X:

..X..X.
.X..X..
X..X..X


Similarly, if the input is W = 10, H = 4, N = 5, the output would be:

....X....X
....X....X
....X....X
....X....X


Notes


"Normal English reading order" means going left to right on each line, from the top line to the bottom.
When N is 1 then all the .'s will become X's.
You may use any two distinct printable ASCII characters in place of . and X.


If you use space ( ) then trailing spaces are not required when the result would be visually the same. (Empty lines are still required.)
You may not using something else in place of the newlines that shape the grid.

The exact input format and order of W, H, and N is not super important. Things like [H,W,N] or N\nW,H are alright.
A trailing newline in the output is fine.
The shortest code in bytes wins!


Examples

W = 5, H = 3, N = 1
XXXXX
XXXXX
XXXXX

W = 5, H = 3, N = 2
.X.X.
X.X.X
.X.X.

W = 5, H = 3, N = 3
..X..
X..X.
.X..X

W = 5, H = 3, N = 4
...X.
..X..
.X...

W = 5, H = 3, N = 5
....X
....X
....X

W = 5, H = 3, N = 6
.....
X....
.X...

W = 5, H = 3, N = 7
.....
.X...
...X.

W = 5, H = 3, N = 15
.....
.....
....X

W = 5, H = 3, N = 16 (or more)
.....
.....
.....

W = 1, H = 1, N = 1
X

W = 1, H = 1, N = 2 (or more)
.

W = 8, H = 6, N = 2
.X.X.X.X
.X.X.X.X
.X.X.X.X
.X.X.X.X
.X.X.X.X
.X.X.X.X

W = 8, H = 6, N = 3
..X..X..
X..X..X.
.X..X..X
..X..X..
X..X..X.
.X..X..X

W = 8, H = 6, N = 4
...X...X
...X...X
...X...X
...X...X
...X...X
...X...X

W = 8, H = 6, N = 7
......X.
.....X..
....X...
...X....
..X.....
.X......

W = 8, H = 6, N = 16
........
.......X
........
.......X
........
.......X

W = 37, H = 1, N = 4
...X...X...X...X...X...X...X...X...X.

W = 1, H = 10, N = 8
.
.
.
.
.
.
.
X
.
.
J, 9 5 bytes

$":&amp;1


Uses spaces and 1's and expects input in the form H W f N

Explanation:

$":&amp;1
   &amp;1 bonds the fixed right argument 1 to ":
 ":   formats the right argument number (1) to take up left argument (N) number of cells
      padding with spaces, resulting  in "  1"
$     reshape to H-by-W with repeating the string if necessary 


Usage:

   3 7 ($":&amp;1) 3
  1  1 
 1  1  
1  1  1


Try it online here.