fn main() { let mut nk = String::new(); std::io::stdin().read_line(&mut nk).ok(); let nk: Vec = nk.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let n = nk[0]; let k = nk[1]; let cnt = ((n as f64).sqrt().ceil() as usize).max(n/k + if n%k>0 { 1 } else { 0 }); println!("{}", cnt); let mut result = vec![vec!["."; cnt]; cnt]; for i in 0..cnt { for j in 0..k.min(cnt) { result[i][(j+i)%cnt] = "#"; } println!("{}", result[i].join("")); } }