We’re preparing your current view and syncing the latest data.
The problem requires printing a grid where a snake moves through rows following a specific pattern. For each odd-numbered row the snake is represented by '#' characters throughout, and for even-numbered rows, the snake occupies exactly one position either at the right-end or left-end alternately. The remaining positions in even-numbered rows are filled with '.' characters.
The input consists of two integers n and m (1≤n,m≤50), where n is the number of rows and m is the number of columns of the grid.
Output the pattern with n rows and m columns representing the snake.
1 ≤ n, m ≤ 50
Example 1
Input
3 3
Output
### ..# ###
Explanation
Row 1 is all '#'. Row 2 has '#' at the right end. Row 3 is all '#'.
Example 2
Input
5 5
Output
##### ....# ##### #.... #####
Explanation
Odd rows are full of '#'. Even rows alternate '#' position: right end on row 2 and left end on row 4.