#include <bits/stdc++.h>

//define fin cin
//define fout cout

#define F first
#define S second
#define pii pair < int , int >

using namespace std;

typedef long long ll;

ll mod1 , mod2;

ll cmmdc(ll a , ll b)
{
    ll r = a % b;
    while (r)
    {
        a = b;
        b = r;
        r = a % b;
    }

    return b;
}

int main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.in","r",stdin);
    freopen("output.out","w",stdout);
    #endif // ONLINE_JUDGE

    /*
    ifstream fin("input.in");
    ofstream fout("output.out");
    */

    scanf("%lld %lld", &mod1 , &mod2);

    printf("2\n");
    printf("1 %lld\n", mod1 * mod2 / cmmdc(mod1 , mod2));
    printf("3 0\n");

    return 0;
}