#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) begin(x), end(x)
#define chmax(x,y) x = max(x,y)
using namespace std;
typedef long long ll;
typedef pair <int,int> P;

int main(){
  int a,b;
  cin>>a>>b;

  cout<<100<<' '<<100<<endl;

  string s1(100,'#'),s2(100,'.');
  a--; b--;
  rep(i,50){
    if(i%2==1) cout<<s1;
    else{
      rep(j,50){
	if(a){
	  cout<<".#";
	  a--;
	}
	else{
	  cout<<"##";
	}
      }
    }
    cout<<endl;
  }
  rep(i,50){
    if(i%2==0) cout<<s2;
    else{
      rep(j,50){
	if(b){
	  cout<<"#.";
	  b--;
	}
	else{
	  cout<<"..";
	}
      }
    }
    cout<<endl;
  }
  return 0;
}

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using product = pair<ll,ll>;
using graph = vector<vector<ll>>;
using vll = vector<ll>;
 
template <class type> void printVector(vector<type> vec){
    stringstream ss;
    for(ll i=0;i<vec.size();i++)
    {
        ss<<vec[i]<<" ";
        if(i!=vec.size()-1)ss<<" ";
    }
    cout<<ss.str()<<endl;
}


//vector<pair<ll,ll> > prime_factorize(ll n) {
    //vector<pair<ll,ll>> res;
    //for (long long p = 2; p * p <= n; ++p) {
        //if (n % p != 0) continue;
        //int num = 0;
        //while (n % p == 0) { ++num; n /= p; }
        //res.push_back(make_pair(p, num));
    //}
    //if (n != 1) res.push_back(make_pair(n, 1));
    //return res;
//}
 
vector<pair<ll,ll>> prime_factorize(ll num)
{
    vector<pair<ll,ll>> res;
    for(ll p=2;p*p<=num;++p){
        if(num%p!=0)continue;
        ll ex=0;
        while(num%p==0){
            ++ex;
            num/=p;
        }
        res.push_back({p,ex});
    }
    if(num!=1)res.push_back({num,1});
    return res;
}


ll GCD(ll a, ll b) {
    if (b == 0) return a;
    else return GCD(b, a % b);
}

void solve(){
    ll A,B;
    cin>>A>>B;
    ll gcd=GCD(A,B);
    ll res=prime_factorize(gcd).size()+1;
    cout<<res;
}
 
int main(){
    solve();
    return 0;
}