#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <bitset>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <string>
#include <chrono>
#include <random>
#include <cmath>
#include <cassert>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <functional>
#include <sstream>

using namespace std;


int main(int argc, char** argv) {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int a, b;
    cin >> a >> b;

    string S = ".#";
    vector<int> cnts{a, b};
    vector<string> res;


    auto build = [&](char B, char W, int n, int width) {
        int cnt = (width + 1) / 2;
        int height = 2 * ((n + cnt - 1) / cnt);
        vector<string> res(height, string(width, B));
        for (int i = 1; i < height; i += 2) {
            for (int j = 0; j < width; j += 2) {
                res[i][j] = W;
            }
        }
        if (n % cnt) {
            int l = (n % cnt - 1) * 2;
            for (int i = l; i < width; ++i) {
                res[height - 1][i] = W;
            }
        }
        return res;
    };

    if (a == 1 && b == 1) {
        res.push_back("..##");
    } else if (a == 1) {
        res = build('.', '#', b, 50);
    } else if (b == 1) {
        res = build('#', '.', a, 50);
    } else {
        auto A = build('.', '#', b - 1, 100);
        auto B = build('#', '.', a - 1, 100);

        reverse(A.begin(), A.end());
        for (auto& s : A) {
            res.push_back(s);
        }
        for (auto& s : B) {
            res.push_back(s);
        }
    }

    auto check = [&](vector<string>& M, int a, int b) {
        int n = M.size();
        int m = M[0].size();

        vector<vector<bool>> visited(n, vector<bool>(m, false));
        vector<pair<int,int>> que(n * m + 123);
        vector<int> X{-1, 1, 0, 0};
        vector<int> Y{0, 0, -1, 1};
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < m; ++j) {
                if (!visited[i][j]) {
                    visited[i][j] = true;
                    int sz = 0;
                    que[sz++] = make_pair(i, j);
                    if (M[i][j] == S[0]) {
                        --a;
                    } else {
                        --b;
                    }

                    for (int k = 0; k < sz; ++k) {
                        int x = que[k].first;
                        int y = que[k].second;

                        for (int l = 0; l < X.size(); ++l) {
                            int nx = x + X[l], ny = y + Y[l];
                            if (nx >= 0 && nx < n && ny >= 0 && ny < m && M[nx][ny] == M[x][y]) {
                                if (!visited[nx][ny]) {
                                    visited[nx][ny] = true;
                                    que[sz++] = make_pair(nx, ny);
                                }
                            }
                        }
                    }
                }
            }
        }

        return a == 0 && b == 0;
    };

    // if (!check(res, a, b)) {
    //     cout << "WA" << endl;
    // }

    cout << res.size() << ' ' << res[0].length() << '\n';
    for (auto& s : res) {
        cout << s << '\n';
    }

    return 0;
}

Measured memory_bytes: 256