#include using namespace std; using LL = long long; using ULL = unsigned long long; #define rep(i,n) for(int i=0; i<(n); i++) int main() { int N, K; cin >> N >> K; int R = (N - 1) / K + 1; cout << R << endl; rep(y, R) { rep(x, R) { bool black = false; if ((x + y) % R < K) if (N != 0) { N--; black = true; } cout << (black ? "#" : "."); } cout << endl; } return 0; }