← Home
```go
package main

import "fmt"

func main() {
	var n, m int
	fmt.Scan(&n, &m)

	for i := 0; i < n; i++ {
		if i%2 == 0 {
			// Full row of hashes
			for j := 0; j < m; j++ {
				fmt.Print("#")
			}
		} else {
			// Odd rows: check direction based on the row index
			// Rows 1, 5, 9... (index % 4 == 1) have hash at the end
			// Rows 3, 7, 11... (index % 4 == 3) have hash at the start
			if i%4 == 1 {
				for j := 0; j < m-1; j++ {
					fmt.Print(".")
				}
				fmt.Print("#")
			} else {
				fmt.Print("#")
				for j := 0; j < m-1; j++ {
					fmt.Print(".")
				}
			}
		}
		fmt.Println()
	}
}
```