{
    ACM ICPC 2003-2004 NEERC

    Problem:    Game
    Author:     Andrew Stankevich
    Solution:   Andrew Stankevich
}

{$DEFINE ALLOWMULTITEST}
{$APPTYPE CONSOLE}
{$O-,Q+,R+}
program game;

type
    tguess = record
        x, y: longint;
        p: boolean;
    end;

const
    maxn = 200;

var
    n, m: longint;
    i, sum, prd, maxsum, maxprd: longint;
    sc, sn, ss: array [1..2 * maxn] of longint;
    pc, pn, ps: array [1..maxn * maxn] of longint;
    sp: array [1..2 * maxn, 1..maxn] of tguess;
    pp: array [1..maxn * maxn, 1..maxn] of tguess;
    sa: array [1..2 * maxn] of tguess;
    pa: array [1..maxn * maxn] of tguess;
    flag: boolean;
    step: longint;
    answer: longint;

begin

    if eoln then runerror(239);
    read(n);
    if eoln or eof then runerror(239);
    read(m);
    if eof or not eoln then runerror(239);
    readln;
    {$IFNDEF ALLOWMULTITEST}
    if not eof then runerror(239);
    {$ENDIF}
    if (n < 2) or (n > 200) then runerror(239);
    if (m < 0) or (m > 100) then runerror(239);

    maxsum := n + (n - 1);
    for sum := 3 to maxsum do
    begin
        sc[sum] := 0;
        for i := 1 to (sum - 1) div 2 do
        begin
            if sum - i <= n then
            begin
                inc(sc[sum]);
                sp[sum][sc[sum]].x := i;
                sp[sum][sc[sum]].y := sum - i;
                sp[sum][sc[sum]].p := true;
            end;
        end;
        sn[sum] := sc[sum];
    end;

    maxprd := n * (n - 1);
    for prd := 2 to maxprd do
    begin
        pc[prd] := 0;
        i := 1;
        while i * i < prd do
        begin
            if (prd mod i = 0) and (prd div i <= n) then
            begin
                inc(pc[prd]);
                pp[prd][pc[prd]].x := i;
                pp[prd][pc[prd]].y := prd div i;
                pp[prd][pc[prd]].p := true;
            end;
            inc(i);
        end;
        pn[prd] := pc[prd];
    end;

    fillchar(ss, sizeof(ss), $ff);
    fillchar(ps, sizeof(ps), $ff);

    flag := true;
    step := 0;
    answer := 0;
    while flag do
    begin
        flag := false;

        for sum := 3 to maxsum do
        begin
            if ss[sum] = -1 then
            begin
                for i := 1 to sn[sum] do
                    if sp[sum][i].p and (ps[sp[sum][i].x * sp[sum][i].y] <> -1) then
                    begin
                        dec(sc[sum]);
                        sp[sum][i].p := false;
                        flag := true;
                    end;

                if sc[sum] = 0 then
                    ss[sum] := -2;

                if sc[sum] = 1 then
                begin
                    ss[sum] := step;
                    if step = m then
                        inc(answer);
                    for i := 1 to sn[sum] do
                        if sp[sum][i].p then
                        begin
                            sa[sum].x := sp[sum][i].x;
                            sa[sum].y := sp[sum][i].y;
                        end;
                end;
            end;
        end;
        inc(step);

        for prd := 3 to maxprd do
        begin
            if ps[prd] = -1 then
            begin
                for i := 1 to pn[prd] do
                    if pp[prd][i].p and (ss[pp[prd][i].x + pp[prd][i].y] <> -1) then
                    begin
                        dec(pc[prd]);
                        pp[prd][i].p := false;
                        flag := true;
                    end;

                if pc[prd] = 0 then
                    ps[prd] := -2;

                if pc[prd] = 1 then
                begin
                    ps[prd] := step;
                    if step = m then
                        inc(answer);
                    for i := 1 to pn[prd] do
                        if pp[prd][i].p then
                        begin
                            pa[prd].x := pp[prd][i].x;
                            pa[prd].y := pp[prd][i].y;
                        end;
                end;
            end;
        end;
        inc(step);
    end;
{
    for sum := 3 to maxsum do
    begin
        if ss[sum] >= 0 then
            writeln(sum, ' ', ss[sum], '  ', sa[sum].x, '+', sa[sum].y);
    end;

    writeln;

    for prd := 2 to maxprd do
    begin
        if ps[prd] >= 0 then
            writeln(prd, ' ', ps[prd], '  ', pa[prd].x, '*', pa[prd].y);
    end;
}
    writeln(answer);
    for sum := 3 to maxsum do
    begin
        if ss[sum] = m then
            writeln(sa[sum].x, ' ', sa[sum].y);
    end;
    for prd := 2 to maxprd do
    begin
        if ps[prd] = m then
            writeln(pa[prd].x, ' ', pa[prd].y);
    end;

end.