/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author champon
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>
#define se cout << "test ok" << endl;
#define sp << " " <<
using namespace std;
using ll = long long;
using ld = long double;
ll mod = ll(1e9)+7;
ll inf = ll(5e18);
template<typename T1, typename T2> ll ceill(T1 a, T2 b){ return (a+b-1)/b; }
void ans(bool b, ostream& out=cout){ out << (b ? "Yes" : "No") << endl; }
void ans2(bool b, ostream& out=cout){ out << (b ? "YES" : "NO") << endl; }
template<typename T> inline bool chmax(T &a, T b){ if(a<b){a=b; return true;} return false; }
template<typename T> inline bool chmin(T &a, T b){ if(a>b){a=b; return true;} return false; }
template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val){ fill((T*)array, (T*)(array+N), val); }
int dx[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dy[] = {0, 1, 0, -1, 1, -1, -1, 1};

#ifndef INCLUDE_DEBUG_HPP
#define INCLUDE_DEBUG_HPP

#include <iostream>
#include <vector>
#include <map>
using namespace std;

namespace dbg {
    using ll = long long;

    class Debug {
    public:
        Debug(){}
        template<typename T>
        void vd(vector<T> vec);
        template<typename T>
        void vd2(vector<vector<T>> vec);
        template<typename T>
        void ad(T *arr, ll n);
        template<typename T, size_t N>
        void ad2(T (&arr)[N], ll n);
        template<typename T>
        void md(T mp);
    };

    template<typename T>
    void Debug::vd(vector<T> vec) {
        for (auto vv : vec) cout << vv << " ";
        cout << endl;
    }

    template<typename T>
    void Debug::vd2(vector<vector<T>> vec) {
        for (auto vv : vec) for (auto vvv : vv) cout << vvv << " ";
        cout << endl;
    }

    template<typename T>
    void Debug::ad(T *arr, ll n) {
        for (int i = 0; i <= n; i++) cout << arr[i] << " ";
        cout << endl;
    }

    template<typename T, size_t N>
    void Debug::ad2(T (&arr)[N], ll n) {
        for (int i = 0; i <= N; i++) for (int j = 0; j <= n; j++) cout << arr[i][j] << " ";
        cout << endl;
    }

    template<typename T>
    void Debug::md(T mp) {
        cout << "key : value" << endl;
        for (auto const &m : mp) cout << m.first << " : " << m.second << endl;
        cout << endl;
    }

}

#endif //INCLUDE_DEBUG_HPP

using dbg::Debug;
Debug debug;

class DGridComponents {
public:
	void solve(std::istream& in, std::ostream& out) {
	    int a, b;
	    in >> a >> b;

	    vector<vector<char>> g(100, vector<char>(100, '#'));
	    for(int i=0; i<100; i++){
	        if(i >= 50) break;
	        for(int j=0; j<100; j++){
                g[i][j] = '.';
	        }
	    }

	    int cnt = 0;
	    for(int i=0; i<50; i++){
	        if(i%2 == 1) continue;
	        for(int j=0; j<100; j++){
                if(cnt == b-1) break;
                if(i%2 == j%2) {
                    g[i][j] = '#';
                    cnt++;
                }
	        }
	    }
	    cnt = 0;
	    for(int i=99; i>=50; i--){
            if(i%2 == 0) continue;
	        for(int j=0; j<100; j++){
	            if(cnt == a-1) break;
	            if(i%2 == j%2){
	                g[i][j] = '.';
	                cnt++;
	            }
	        }
	    }

	    out << 100 sp 100 << endl;
	    for(int i=0; i<100; i++){
	        for(int j=0; j<100; j++){
	            out << g[i][j];
	        }
	        out << endl;
	    }
	}
};


int main() {
	DGridComponents solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define mp make_pair
#define PI pair<int,int>
#define lowbit(i) i&-i
#define For(i,l,r) for(int i=(int)(l);i<=(int)(r);i++)
#define Rep(i,r,l) for(int i=(int)(r);i>=(int)(l);i--)
#define pb push_back
#define fi first
#define se second
inline char gc(){
    static char buf[100000],*p1=buf,*p2=buf;
    return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
#define gc getchar
inline ll read(){
	ll x = 0; char ch = gc(); bool positive = 1;
	for (; !isdigit(ch); ch = gc())	if (ch == '-')	positive = 0;
	for (; isdigit(ch); ch = gc())	x = x * 10 + ch - '0';
	return positive ? x : -x;
}
inline void write(ll a){
    if(a<0){
    	a=-a; putchar('-');
	}
    if(a>=10)write(a/10);
    putchar('0'+a%10);
}
inline void writeln(ll a){write(a); puts("");}
inline void wri(ll a){write(a); putchar(' ');}
inline ull rnd(){
	ull ans=0; For(i,0,5)ans=ans<<15^rand(); return ans;
}
ll ycl[20],f[10],ans,d,L;
ll xqz(ll x,ll y){
	if(x>=0)return x/y;
	x=-x;
	x--; return -x/y-1;
}
void dfs(int p,ll xs,ll d){
	if(p==L/2){
		if(d==0)ans+=xs*((L&1)?10:1); return;
	}
	ll cz=ycl[L-1-p]-ycl[p],t=xqz(d,cz);
	//cout<<d<<" "<<cz<<" "<<t<<" "<<L/2<<endl;
	if(abs(t)<=9){
		dfs(p+1,xs*(f[abs(t)]-(p==0&&t>=0)),d-t*cz);
	}
	t++;
	if(abs(t)<=9){
		dfs(p+1,xs*(f[abs(t)]-(p==0&&t>=0)),d-t*cz);
	}
}
void get(int len,ll d){
	L=len;
	dfs(0,1,d);
}
int main(){
	For(i,0,9)For(j,0,i)f[i-j]++;
	d=read();
	int ws=1;
	For(i,ycl[0]=1,18){ycl[i]=ycl[i-1]*10; if(d>=ycl[i])ws++;}
	//get(2,d); cerr<<ans<<endl; return 0;
	For(i,max(2,ws),2*ws){
		get(i,d);
	}
	cout<<ans<<endl;
}