{$r+,q+,o-}
{$apptype console}
type
    int = longint;

const
    MAX_TEST = 100;
    MAXN = 1000000000;

var
    curTest: int;

procedure write_test(a, b: int);
begin
    inc(curTest);
    rewrite(output, chr(ord('0') + curTest div 10) + chr(ord('0') + curTest mod 10));

    assert((1 <= a) and (a <= MAXN));
    assert((1 <= b) and (b <= MAXN));
    writeln(a, ' ', b);

    close(output);
end;

var
    xa, xb, p: array [1..MAX_TEST] of int;
    n: int;

procedure add_test(a, b: int);
begin
    inc(n);
    xa[n] := a;
    xb[n] := b;
    p[n] := n;
end;

procedure write_tests();
 var
    i, j: int;

begin
    for i := 2 to n do begin
        j := random(i) + 1;
        p[i] := p[j];
        p[j] := i;
    end;

    for i := 1 to n do
        write_test(xa[p[i]], xb[p[i]]);

    n := 0;
end;

var
    d, i, j: int;

begin
    curTest := 0;
    randseed := 23925471;

    add_test(3, 3);
    write_tests();

    add_test(2, 4);
    write_tests();

    for i := 1 to 2 do
        for j := 1 to 2 do
            add_test(i, j);

    add_test(1, MAXN);
    add_test(2, MAXN);
    add_test(3, MAXN);
    add_test(MAXN, 1);
    add_test(MAXN, 2);
    add_test(MAXN, 3);
    write_tests();
    for i := 1 to 10 do begin
        d := random(MAXN div 1000000);
        add_test(d * (random(MAXN div d) + 1) + 1, d * (random(MAXN div d) + 1) + 1);

        d := random(MAXN div 10000);
        add_test(d * (random(MAXN div d) + 1) + 1, d * (random(MAXN div d) + 1) + 1);

        d := random(MAXN div 100);
        add_test(d * (random(MAXN div d) + 1) + 1, d * (random(MAXN div d) + 1) + 1);

        d := random(MAXN div 10);
        add_test(d * (random(MAXN div d) + 1) + 1, d * (random(MAXN div d) + 1) + 1);
    end;
    add_test(MAXN - 5, MAXN - 5);
    add_test(MAXN, MAXN);
    write_tests();
end.
