#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pli = pair<ll, int>;
using Graph = vector<vector<bool>>;
const int MOD = 1e9 + 7;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int A, B;
    cin >> A >> B;
    A--, B--;

    int C = 0, D = 0, W = 0;
    for (int i = 0; i * i < max(A, B); ++i)
        W++;
    W = max(2 * W, 1);

    C = (4 * A + W - 1) / W, D = (4 * B + W - 1) / W;
    C += C & 1, D += D & 1;
    C = max(C + (C & 1), 1), D = max(D + (D & 1), 1);

    printf("%d %d\n", C + D, W);

    for (int i = 0; i < C; ++i) {
        for (int j = 0; j < W; ++j) {
            bool iswhite = (A > 0) & !((i | j) & 1);
            A -= iswhite;
            putchar(iswhite ? '.' : '#');
        }
        putchar('\n');
    }

    for (int i = 0; i < D; ++i) {
        for (int j = 0; j < W; ++j) {
            bool isblack = (B > 0) & (i & j & 1);
            B -= isblack;
            putchar(isblack ? '#' : '.');
        }
        putchar('\n');
    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll  long long
#define endl '\n'
#define FASTINOUT ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const ll mod = 1000000007;
const double PI = 3.141592653589793238463;
const int N=2e5+9;
char a[109][109];
int main()
{
    FASTINOUT;
    int r,c;
    cin>>r>>c;
    r--,c--;
    char l='.';
    for (int i=1;i<=100;i++){
            if (i==50)
            l='#';
        for (int j=1;j<=100;j++)
            a[i][j]=l;
    }
    for (int i=1;i<=49&&c;i+=2){
        for (int j=1;j<=100&&c;j++){
            if (a[i][j-1]!='#'&&a[i-1][j]!='#'){
            a[i][j]='#';
            c--;
            }

        }
    }
    for (int i=52;i<=100&&r;i+=2){
        for (int j=1;j<=100&&r;j++){
            if (a[i][j-1]!='.'&&a[i-1][j]!='.'){
            a[i][j]='.';
            r--;
            }
        }
    }
    cout<<100<<" "<<100<<endl;
    for (int i=1;i<=100;i++){
        for (int j=1;j<=100;j++){
            cout<<a[i][j];
        }
        cout<<endl;
    }
    return 0;
}
