let rec f _ = 
    let (x, y) = Scanf.sscanf(read_line()) "%d %d" (fun x y -> (x, y)) in
    if x = 0 && y = 0 then () 
    else
        let (a, b) = if x < y then (x, y) else (y, x) in
        (Printf.printf "%d %d\n" a b;
        f ());;
        
f ();;
