
(**
 * Culture
 * Problem 1, AIC 2003
 * Pascal Sample Solution
 *)

program Culture;

var
    inFile : text;
    outFile : text;
    total : integer;    { The final number of bacteria. }
    start : integer;    { The number of bacteria we began with. }
    days : integer;     { The number of days the experiment has run. }

begin
    { Open the I/O files. }
    assign(inFile, 'cultin.txt');
    reset(inFile);
    assign(outFile, 'cultout.txt');
    rewrite(outFile);

    { Read in the total number of bacteria. }
    readln(inFile, total);

    { Assume the experiment has been running for 0 days. }
    start := total;
    days := 0;

    { While the initial number of bacteria is still even, halve this
      initial number and add one day to the experiment. }
    while start mod 2 = 0 do begin
        start := start div 2;
        days := days + 1;
    end;

    { Now the initial number of bacteria is odd, so we must have our
      solution. }
    writeln(outFile, start, ' ', days);

    { Tidy up. }
    close(inFile);
    close(outFile);
end.

