let () =
  let max a b = if a > b then a else b in
  let min a b = if a < b then a else b in
  let rec loop () =
    let a, b = Scanf.scanf "%d %d\n" (fun a b -> a, b) in
    if a = 0 && b = 0 then ()
    else (Printf.printf "%d %d\n" (min a b) (max a b); loop ()) in
  loop ()