{
    ACM ICPC 2003-2004 NEERC

    Problem:    Data Mining
    Author:     Roman Elizarov
    Solution:   Andrew Stankevich
}

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

program data_mining;

const
    maxd = 100;

type
    tlong = array [1..maxd] of longint;

function init(x: longint): tlong;
var
    r: tlong;
    i: longint;
begin
    fillchar(r, sizeof(r), 0);
    i := 0;
    while x > 0 do
    begin
        inc(i);
        r[i] := x mod 2;
        x := x div 2;
    end;
    init := r;
end;

procedure add(var x: tlong; y: tlong);
var
    c, i: longint;
begin   
    c := 0;
    for i := 1 to maxd do
    begin
        c := c + x[i] + y[i];
        x[i] := c mod 2;
        c := c div 2;
    end;
end;

function get(const x: tlong; d: longint): longint;
begin
    if (d >= 1) then
        get := x[d]
    else
        get := 0;
end;

function lt(const x, y: tlong; sy: longint): boolean;
var
    i, j: longint;
begin
    i := maxd;
    j := maxd - sy;
    while (i > 1) and (x[i] = get(y, j)) do
    begin
        dec(i);
        dec(j);
    end;
    lt := x[i] < get(y, j);
end;

function eq(const x, y: tlong): boolean;
var
    i: longint;
begin
    eq := false;
    for i := 1 to maxd do
        if x[i] <> y[i] then
            exit;
    eq := true;
end;

procedure print(const x: tlong);
var
    i: longint;
begin
    i := maxd;
    while (i > 1) and (x[i] = 0) do
        dec(i);
    while i > 0 do
    begin
        write(x[i]);
        dec(i);
    end;
end;

function lead(const x: tlong): longint;
var
    i: longint;
begin
    i := maxd;
    while (i > 1) and (x[i] = 0) do
        dec(i);
    lead := i;
end;

procedure shift(var x: tlong; d: longint);
var
    i: longint;
begin
    for i := 1 to maxd - d do
        x[i] := x[i + d];
    for i := maxd - d + 1 to maxd do
        x[i] := 0;
end;

var
    n, p, q: longint;
    pa, qb, pat, pa1, pan, pan1, pant: tlong;
    a, b: longint;
    pad: longint;
    i: longint;
    best: tlong;
    besta, bestb: longint;
    r: longint;

begin

    if eoln then runerror(239);
    read(n);
    if eoln then runerror(239);
    read(p);
    if eoln then runerror(239);
    read(q);
    if eof or not eoln then runerror(239);
    readln;
    {$IFNDEF ALLOWMULTITEST}
    if not eof then runerror(239);
    {$ENDIF}

    if (n < 1) or (n > (1 shl 20)) then runerror (239);
    if (p < 1) or (p > (1 shl 10)) then runerror (239);
    if (q < 1) or (q > (1 shl 10)) then runerror (239);

    if n = 1 then
    begin
        besta := 0;
        bestb := 0;
        r := 0
    end else begin
        pan := init(p * (n - 1));
        pad := lead(pan);

        pa := init(p);
        qb := init(q);

        besta := -1;
        bestb := -1;

        b := 0;
        while b <= pad + 1 do
        begin
            a := 0;
            pat := pa;
            pa1 := pat;
            add(pa1, pa);

            pant := pan;
            pan1 := pan;
            add(pan1, pan);

            while lt(pa1, qb, b) do
            begin
                inc(a);
                add(pa1, pat);
                add(pat, pat);

                add(pan1, pant);
                add(pant, pant);
            end;

            shift(pan1, b);
            if (besta = -1) or lt(pan1, best, 0) or (eq(best, pan1) and (a < besta)) then
            begin   
                best := pan1;
                besta := a;
                bestb := b;
            end;

            inc(b);
        end;

        r := 0;
        for i := maxd downto 1 do
            r := r * 2 + best[i];
    end;

    writeln(r + q, ' ', besta, ' ', bestb);

end.